Problem 26690 --Clock(II)

26690: Clock(II)

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 37  Solved: 6
[Submit][Status][Web Board][Creator:][下载FPS1元][添加到购物车][下载测试数据1元][32kb]

Description

Clock is invented by ancient Arabic engineers and which contributes to build the concept of accurate time for us human beings and even could be essential tool that widely used in industry, business and our routine lives. Nevertheless, the ideology of clock turns out to be quite simply that even make sense to little kids. We could hardly imagine that how do Arabic wisdom come up with such idea to indicate time only by two or three fingers. The other day, Tim are asking Jim and Hysramp to play his newly invented game describe as follow. Tim randomly change the time of his lovely alarm clock then ask Jim and Hysramp to tell the degree between hour finger and minute finger. Jim seems quite gifted playing it while Hysramp does not. When Hysramp fails to answer Tim, Tim smiles to Hysramp, and Hysramp smiles to you, an ace programmer.


在原题基础上增加秒针,求给定时间,三个针中最小的夹角。

Input

The first line of the input contains one integer T, which indicate the number of test cases. Each test case contains one indicating the time on Tim 's clock in the form of HH:MM:SS. (0 ≤ HH < 24, 0 ≤ MM < 60, 0 ≤ SS < 60


Output

One line for each test case contains only one number indicating the answer. An integer or an irreducible fraction indicated the minimal degree D among hour finger, minute finger and second finger(0 ≤ D<360). 

Sample Input

3
00:00:00
09:45:00
00:00:01

Sample Output

0
45/2
11/120

HINT

Source

[Submit][Status]