Effective Infection Time#6606

Effective Infection Time

1 second
64 megabytes
Easy

You are estimating the threat level of quarantined zones that have been abandoned to the infection. One of the key variables in determining a zone's threat level is the EIT (Effective Infection Time). This information is essential for planning strike dates to reclaim quarantined zones. The EIT is calculated according to the following rules:

The number and order of months in a calendar year remain the same as the modern Gregorian calendar.

Input

The first line will be an integer , where 1 \leq N \leq 50, giving the number of zones. For each zone, a pair of lines will be provided:

  • The first line contains the infection date. The second contains the strike date.

  • The first integer of a date represents the month, (1 \leq M \leq 12), and the second integer represents the year, (0000 \leq Y \leq 0030). The year will always have digits.

  • The strike date will never precede the infection date.

Output

Output the EIT for each zone on its own line. The EIT must be rounded to the fourth digit after the decimal point. The ones digit must always be printed, even if it is zero.

Examples

Example 1

Loading
Loading