Given a year ~Y~ ~(0 \le Y \le 3\,000)~, month ~M~ ~(1 \le M \le 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.
Line ~1~: One integer T ~(1 \le T \le 100)~ denoting the number of test cases.
Lines ~2\ldots T+1~: Three integers ~Y~, ~M~, ~D~.
Lines ~1\ldots T~: One integer denoting how many days have passed since the beginning of the year.
2 1990 1 1 1992 3 1