题目描述

(Calculating Number of Seconds) Write a function that takes the time as three integer arguments (hours, minutes and seconds) and returns the number of seconds since the last time the clock “struck 12.” Use this function to calculate the amount of time in seconds between two times, both of which are within one 12-hour cycle of the clock.


输入格式

The input consists of n (0<n<100) samples.
Each sample consists of two lines.
Each line of each sample consists of hours(ranges from 0 to 11), minutes(ranges from 0 to 59), seconds(ranges from 0 to 59)
The last line of input consists of Int(-1).


输出格式

Output the amount of time in seconds between two times


样例数据

输入

6 7 5
5 7 4
5 7 5
6 7 4
-1

输出

3601
3599

备注


操作

评测记录

优秀代码

信息

时间限制: 1s
内存限制: 128MB
评测模式: Normal

题解