-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
48 lines (40 loc) · 1.5 KB
/
main.cpp
File metadata and controls
48 lines (40 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <iostream>
#include<cmath>
#include<iomanip>
using namespace std;
int main()
{
int N;
int n2;
cin>>N;
for (int i=1;i<=N;i++)
{
int m,n;
cin>> m>>n;
if (m<1||m>12||n<0||n>60)
{
double k=0;
cout << fixed <<setprecision(5)<<k<<"\n";
}
else
{
double t1,t2;
int k1 =-1;
t1 = (360*k1-6*n+30*m)/(5.5);
while (t1<0)
{
k1++;
t1=(360*k1-6*n+30*m)/(5.5);
}
cout << fixed<<setprecision(5)<<t1<<"\n";
int k2 = -2;
t2 =(90+180*k2-6*n+30*m)/(5.5);
while (t2<0)
{
k2++;
t2=(90+180*k2-6*n+30*m)/(5.5);
}
cout << fixed <<setprecision(5)<<t2<<"\n";
}
}
}