Under construction

Still being built. Things may change

Year Progress Bar

Interview

Time limit2sMemory limit128 MB

Summary
Given a date and time string, compute what percentage of the current year (accounting for leap years) has elapsed.
Level

Easy2 of 10

Topics
Implementation, Math
Solved
No attempts yet

Problem

Moonbing likes the New Year, but the next New Year is still far away. Even so, Moonbing keeps waiting for it.

One day, Moonbing woke up and wondered, "How much of this year has passed so far?"

To answer that question, Moonbing decided to make a simple application that shows the progress of the current year as a percentage.

Given the current date and time, write a program that prints what percentage of the current year has passed.

Input

The first line gives the date and time in the format Month DD, YYYY HH:MM. Month is the English name of the current month, and YYYY is the four-digit year. DD, HH, and MM are two-digit numbers representing the current day, hour, and minute.

Month is one of January, February, March, April, May, June, July, August, September, October, November, and December. The year is between 1800 and 2600, inclusive. The input is always a valid date and time.

Output

Print, on the first line, the percentage of the current year that has passed. An absolute or relative error of at most 10^-9 is accepted.

Hint

In a common year, the months have 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, and 31 days, respectively. In a leap year, February has 29 days.

A year is a leap year if it is divisible by 400, or if it is divisible by 4 but not by 100. Daylight saving time for local regions is not considered.

Examples6

  1. Example 1

    Input
    May 10, 1981 00:31
    
    Expected output
    35.348363774733635
    
  2. Example 2

    Input
    January 01, 2008 00:00
    
    Expected output
    0.0
    
  3. Example 3

    Input
    December 31, 2007 23:59
    
    Expected output
    99.99980974124807
    
  4. Example 4

    Input
    July 02, 2007 12:00
    
    Expected output
    50.0
    
  5. Example 5

    Input
    July 02, 2008 00:00
    
    Expected output
    50.0
    
  6. Example 6

    Input
    January 31, 1900 00:47
    
    Expected output
    8.228120243531203