Clock Triangles III

Problem #60

Tags: geometry puzzle timed

Who solved this?

Previous:Clock Triangles II Next:Pixel Circles


Continuing from Stephen's previous boredom with his kitchen clock...

After being so engrossed staring at the clock and imagining triangles, Stephen suddenly realizes that hours have passed as he has been standing there. He's completely missed his haircut appointment, and also the entirety of the big football game! To prevent this problem from happening again, Stephen decides to determine a method to solve these problems very quickly.

Problem Statement

Nothing below has changed from the previous problem. However there are now many more testcases, and you have just 3 minutes to solve the problem after you are given your input data; so please reload the page to get new input before calculating and submitting the answer.

Input Data
First line will be Q, the quantity of testcases.
Q lines will then follow, each with two space-separated time values t_start and t_end.

Answer
Should consist of Q space-separated integers, corresponding to the percentage of time between the specified times in each testcase during which an acute triangle would be formed by the clock.
Report percentages as decimals. For example, 50% should be reported as 0.5.
Answers should be accurate to 1e-6.

Example

input data:
4
10:29:22 10:29:23
10:29:21 10:29:24
10:29:20 02:34:56
12:00:01 12:00:00

answer:
0.447844 0.482615 0.237591 0.249974
You need to login to get test data and submit solution.