ifnextchar ( ifnextchar (offsettrue(0pt,0pt)
offsetfalse ifnextchar [(0pt,0pt)(0pt,0pt)
ifnextchar
[(0pt,0pt)(0pt,0pt)[l](0pt,0pt)(0pt,0pt)[l][]
[r]
El Campanar de la Torrassa is the mythical bell tower of
a church in the district of La Torrassa in the city of L’Hospitalet de
Llobregat. This tower (which celebrates its 75th birthday precisely this
year!) is near the author’s home, where some nice (but not wild!)
parties with the UPC contestants took place. During one of those
parties, Masao heard the sound of the bells, and immediately his
powerful brain started to wander and wonder:
“Let’s suppose that a clock has an hour hand 3 units long, a minute hand
4 units long, and a second hand 5 units long. The hour hand moves once
every hour, the minute hand moves once every minute, and the second hand
moves once every second. Therefore, exactly every second, the triangle
defined by the ends of the hands changes its area.
For instance, to the right you can see the positions of the hands at
00:15:25. Note that the hour hand is vertical and the minute hand is
horizontal.
ifnextchar ( ifnextchar (offsettrue(0pt,0pt)
offsetfalse ifnextchar [(0pt,0pt)(0pt,0pt)
ifnextchar
[(0pt,0pt)(0pt,0pt)[l](0pt,0pt)(0pt,0pt)[l][]
[r]
Which is the maximum area between two given times?”
Input consists of several cases, each with and . You can assume , , , as well as , , . The time is strictly smaller than .
For every case, print with three digits after the decimal point the largest area from to , both times included. This problem has no precision issues, as long as you take special care of times like 01:05:35.
Remember that the area of a triangle with sides of length , and is , where is the semiperimeter of the triangle.
Input
00:00:00 00:00:01 11:59:58 11:59:59 03:59:08 03:59:24 03:59:08 03:59:25 00:00:00 11:59:59
Output
0.261 0.922 7.142 8.395 20.485