I/O Operations Q. 4: Sachin and his Pills

QUESTION DESCRIPTION 

Sachin visits his family doctor on a date given in the format yyyy:mm:dd. Sachin's doctor suggests him to take pills every alternate day starting from that day.

Sachin being a forgetful person are pretty sure won’t be able to remember the last day he took the medicine and would end up in taking the medicines on wrong days.

So he come up with the idea of taking medicine on the dates whose day is odd or even depending on whether dd is odd or even.

Now your task is to find the number of pills Sachin took on right time before messing up for the first time.

Note:

Every year that is exactly divisible by four is a leap year, except for years that are exactly divisible by 100.

The centurial years that are exactly divisible by 400 are still leap years.

For example, the year 1900 is not a leap year; the year 2000 is a leap year.

Input Format:

First line will contain T, number of testcases. Then the testcases follow.

Each testcase contains of a single line of input, in the format yyyy:mm:dd

Output Format:
For each testcase, output in a single line the required answer.

Constraints:

1≤T≤1000

1900≤yyyy≤2038

yyyy:mm:dd is a valid date





Solution Will Be Uploaded Soon

Comments

Popular Posts