ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила

1093. Darts

Ограничение времени: 1.0 секунды
Ограничение памяти: 64 МБ
Maybe you know about the game called Darts. The goal of the game is to hit a circular target, which is called a dartboard. To do so you should take a dart and throw it to the dartboard. Of course, it takes time to learn how to hit the dartboard. And your task is to speed the learning by writing a program that determines if a dart will hit or miss the dartboard.
Let's make some assumptions about the objects under consideration.
  1. A dartboard is a circular part of a plane. It is defined by coordinates of its center (Cx, Cy and Cz), radius R, and coordinates of a vector that is orthogonal to the plane of the dartboard (Nx, Ny and Nz).
  2. A dart is a point that moves according the following equations:
    Mx = Sx + Vx·t
    My = Sy + Vy·t
    Mz = Sz + Vz·t − (g/2)·t2
    Here Sx, Sy, and Sz are coordinates of initial position of the dart, Vx, Vy, and Vz are components of initial velocity of the dart, Mx, My, and Mz are coordinates of the point where the dart will be at time t, g is the acceleration of gravity and is assumed to be equal to 10.
  3. You may assume that the dart is thrown with a nonzero horizontal component (i.e. Vx or Vy is non-zero).
  4. You may assume no friction.
  5. To hit the dartboard the dart should hit it strictly inside boundary from any side.
  6. Initially the dart is not inside the dartboard's boundary.

Исходные данные

Input contains 13 real numbers. They are (according to notation given before):
Cx Cy Cz Nx Ny Nz R
Sx Sy Sz Vx Vy Vz

All numbers are not greater than 500 in their absolute values and given with at most 4 digits after decimal point. R is positive.

Результат

Output should contain the only word "HIT" (without quotes) if dart hits the dartboard, and word "MISSED" otherwise.

Пример

исходные данныерезультат
47 0 -72 1 0 1 4.25
0 0 0 10 0 10
HIT
Автор задачи: Александр Клепинин
Источник задачи: USU Open Collegiate Programming Contest March'2001 Senior Session