Holiday Stars

아직 제출이 없습니다시간 제한2초메모리 제한1024 MB

문제

A Holiday Star hurtling towards a wall

It is the time for the Holidays, which means it's time for the annual Holiday Cookie Throwing contest where cookies are thrown against a wall. Cookies are really simple polygons that rotate clockwise while in flight.

Due to many years of advanced research and precise throwing equipment, these cookies can fly under idealized conditions: their center of mass follows an ideal parabola (g=9.81ms2g = 9.81 \frac{m}{s^2}), and their angular velocity stays constant.

Given a cookie's shape, initial angle and speed as well as its angular velocity, compute which of the cookie's corners hits the wall first, and when!

입력

The input consists of a single test case. The first line contains 55 numbers: an integer nn (3n203 \le n \le 20) denoting the number of vertices of the cookie polygon, a real number ω\omega (0ω100 \le \omega \le 10), the angular velocity in rad/s\text{rad}/s in clockwise direction, a real number v_0v\_0 (1<v_0<101 < v\_0 < 10), the initial velocity of the cookie in ms\frac{m}{s}, a real number θ\theta (0θ800 \le \theta \le 80), the initial angle of the cookie's trajectory, given in degrees measured counter-clockwise relative to the (1,0)(1, 0) unit vector, a real number ww (20w50020 \le w \le 500), denoting the xx-coordinate of the wall towards which the cookie is moving.  You may assume that there are no other objects in space aside from the cookie, and that the wall is of infinite height (e.g., from -\infty \ldots \infty).

This is followed by nn lines, one for each vertex. Each line contains two real numbers x_ix\_i and y_iy\_i (x_i<20,y_i<20|x\_i| < 20, |y\_i| < 20) denoting the initial position of a cookie's corner.  Corners are numbered 1n1 \ldots n. The cookie polygon's vertices are given in counter-clockwise order. The polygon is simple (e.g., not self-intersecting) and has a non-zero area.

All real numbers are given with no more than 66 decimal digits after the period.

출력

Output two numbers ii and T_iT\_i, denoting the index ii (1in1 \le i \le n) of the corner that hits the wall first and the time T_iT\_i in seconds when that happens. The index corresponds to the order in the input. T_iT\_i must be given with an absolute error of less than 10310^{-3}! You may assume that no two vertices hit the wall within 10210^{-2} seconds of each other, and that the first vertex to hit the wall would pierce it for at least 10310^{-3} seconds.