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 EIT is the result of a function of two dates: the infection date and the strike date.
All years are in A.Z. (After Zombie).
Every month counts for a fraction of an EIT after its last day has passed. This means the month of the strike date does not count for EIT.
The first calendar year of the infection is calculated as EIT.
If the end of the year is not reached, each month only counts for a fraction of the EIT. If a zone was infected in January of the first year, then the EIT is spread across months, ((1/2)/12 \approx 0.0417) EIT per month. If a zone was infected in March of the first year, then the EIT is spread across months, ((1/2)/10 = 0.0500) EIT per month.
If the end of the year is reached, the year counts as a full EIT, regardless of the infection month. In other words, a zone infected in February of A.Z. counts as only (one-half) EIT after December A.Z. A zone infected in December of the same year will also count as EIT.
All following years are calculated as EIT. Each calendar month, beginning with January, counts for EIT ( EIT).
Every zone infected in the same month will have the same EIT for any given strike date. Therefore, only the month and year are given.
The number and order of months in a calendar year remain the same as the modern Gregorian calendar.
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 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.
Example 1