描述:
The three hands of the clock are rotating every second and meeting each other many times everyday. Finally, they get bored of this and each of them would like to stay away from the other two. A hand is happy if it is at least D degrees from any of the rest. You are to calculate how much time in a day that all the hands are happy.
钟的三根指针每时每刻都在转动,每天都会碰见很多次。终于,他们厌倦了这样的日子想要远离彼此。如果指针和其他任意一个指针的角度超过D度,这个指针就会感到开心。你需要去计算一天中有多少时间每根指针都开心。
输入:
The input contains many test cases. Each of them has a single line with a real number D between 0 and 120, inclusively. The input is terminated with a D of -1.
输入包括多组数据。每组单行输入一个实数D,范围为0-120。输入-1停止输入。
输出:
For each D, print in a single line the percentage of time in a day that all of the hands are happy, accurate up to 3 decimal places.
对于每个D,单行输出一天内所有指针都开心的时间占总时间的百分数,精确到小数点后三位。
词汇:hand 指针 rotate 旋转 stay away from...远离 the rest 剩下的 terminate 停止 decimal place 小数位 inclusively 包含地