BlueBook

p307ex10: Days

Given a year Y (0 ≤ Y ≤ 3000), month M (1 ≤ M ≤ 12), and day D (depends on what month it is, but will be correct input), output how many days it has been since the beginning of the year.

Be sure to take care of leap years! The year 0 is a leap year..

Input

Line 1: One integer T (1 ≤ T ≤ 100) denoting the number of test cases.
Lines 2..T+1: Three integers Y, M, D.

Output

Lines 1..T: One integer denoting how many days have passed since the beginning of the year.

Sample Input

2
1990 1 1
1992 3 1

Sample Output

1
61

All Submissions
Best Solutions


Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Oct 31, 2008

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

I did everything right????

Obviously you did not, or your code would have gotten AC.

Try coming up with some test cases yourself and solving them by hand. Being able to figure out why your code is wrong is an extremely useful skill.

As the title says

Typically, you should try a good deal of debugging and making cases before posting on the comments for help; you appear to have spent all of 3 minutes on this step.

However, I will tell you that it probably has something to do with your variable "i"

My code works when I put in actual numbers, but when i submit it the code creates an error.

Please do not post your code in comments. Admins and people who have solved the problem can see your code anyway, and they may help if they choose to.

Your error is: ValueError: invalid literal for int() with base 10.

May I suggest asking your PEG leaders for help in the future?