HDU 2076 How big is the angle?

Source: Internet
Author: User

How big is the angle?

Time limit:1000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)

Total submission (s): 12533 Accepted Submission (s): 4969

Problem Description

Time too fast, a semester so the past, XHD in a silly look at the table, out of the desire for data, suddenly he wanted to know the table of the hour and minute hand angle is how much. Now XHD know only time, ask you to help him figure out this angle.

Note: The range of the angle [0,180], the rotation of the hour and minute hand is continuous rather than discrete.

Input

The first line of the input data is a data T, which indicates that there is a T group of data.

Each group of data has three integers h (0 <= H < x), m (0 <= m <), s (0 <= s < 60) representing hours, minutes, and seconds, respectively.

Output

For each set of input data, an integer portion of the size of the output angle.

Sample Input

2

8 3 17

5 13 30

Sample Output

138

75

Author

Xhd

Source

ACM Program Design Final Exam-warm-up (Thanks XHD & 8600)

1 //one turn every hour .2#include <iostream>3#include <cstdio>4#include <cmath>5 using namespacestd;6 intMain ()7 {8     intT;9Cin>>T;Ten     inth,m,s; One      while(t--){ ACin>>h>>m>>s; -         if(h>= A) h-= A; -         DoubleAns=fabs (360.0/ A* (h+m/60.0+s/3600.0)-360.0/ -* (m+s/60.0)); the         if(ans> the) printf ("%d\n",(int)( the-ans)); -         Elseprintf"%d\n",(int) ans); -     } -     return 0; +}

HDU 2076 How big is the angle?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.