Astronomy

시간 제한1초메모리 제한1024 MB

요약
지구의 원형 공전, 기울어진 자전축, 하루 자전을 모형화해 주어진 날짜와 시각에서 태양 광선과 지표 접평면이 이루는 각을 구하고, 밤이면 0.00을 출력한다.
난이도

어려움10점 중 8점

유형
수학, 기하, 시뮬레이션, 구현
정답자
아직 제출이 없습니다

문제

Android Vasya attends his Astronomy classes. Today on the laboratory work he had to count out the obliquity angle of sun rays. Help Vasya do this using the following facts.

  • The Earth orbit is a circle with the center in the center of the Sun. The Earth evenly moves along it counter clockwise, if to watch at the plane of the Erath orbit from the North Pole. A complete circle is made for exactly 365 days.
  • The Earth is a full sphere, rotating round its axis counter clockwise, if to watch at it from the North Pole. The Earth axis of rotation digresses from the perpendicular to the plane of the Earth orbit for 23.439281 degrees.
  • The meredian where Vasya is located is the nearest meredian to the Earth orbit's center at each midday. The period from one midday to the next one lasts exactly one day, i.e. 24 hours. The moment of summer solstice falls at midday of 21 of June.
  • At each moment of time sun rays can be considered parallel to the segment which connects the Earth center with the Earth's orbit center.

입력

The first line contains a real number ll --- the latitude of the point of Vasya's being and an integer nn --- the number of tests (ll contains not more than two digits after the decimal point; −89.99≤l≤89.99-89.99 \leq l \leq 89.99; 1≤n≤87601 \leq n \leq 8760). Each of the next nn lines contains an integer dd --- the day of a month, the string mm --- a short name of a month, and an integer hh --- the hour. mm may take one of the following values: jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec. dd lies within the range from 11 to the number of days in the month mm. 0≤h≤230 \leq h \leq 23. The calendar is the same as in the Gregorian style for the non-leap years.

출력

Output one line for every test containing the angle in degrees between the Sun rays and the plane, which is tangent to the Earth surface at the point of Vasya's being, at given day hh hours and 0 minutes. If at that moment the Sun is under horizon output 0.00. The answers should be output with absolute or relative precision at least 10−610^{-6}.

힌트

The soltice is the moment when Sun rays fall on the Earth parallel to the plane, which is perpendicular to the Earth orbit and goes through the Earth axis. The summer soltice is the one out of two such moments at which the North Pole is lighted.

예제2

  1. 예제 1

    입력
    56 3
    17 nov 12
    17 nov 22
    7 jul 12
    
    예상 출력
    14.496810046
    0.0000000000
    56.491608912
    
  2. 예제 2

    입력
    -66.57 1
    22 jun 12
    
    예상 출력
    0.0000000000