-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogress_pie_source.txt
More file actions
72 lines (71 loc) · 1.02 KB
/
progress_pie_source.txt
File metadata and controls
72 lines (71 loc) · 1.02 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include<iostream>
#include<math.h>
using namespace std;
#define PI 3.14159265
double find_angle(double x,double y)
{
if(x==0)
{
if(y>=0)
return (double)0;
else
return (double)(180);
}
else if(y==0)
{
if(x>0)
return (double)90;
else
return double(270);
}
double ang = atan2 (y,x) * 180 / PI;
if(x>0 && y>0)
{
ang= double(90)-ang;
}
else if(x>0 && y<0)
{
ang= abs(ang) +90;
}
else if(x<0 && y<0)
{
ang= abs(ang) +90;
}
else
{
double temp = ang -90;
ang = 360-temp;
}
return ang;
}
bool israd(double a,double b)
{
return a*a+b*b-double(50*50)<=0;
}
main()
{
freopen("progress_pie.txt","rt",stdin);
freopen("hcupdemo1_example.out","wt",stdout);
int test;
cin>>test;
for(int t=1;t<=test;t++)
{
int p,x,y;
cin>>p>>x>>y;
p=(double)p;
x=(double)x;
y=double(y);
//cout<<p<<x<<y;
p=(double) p*(double)360;
p=p/100;
x=x-50;
y=y-50;
double ang=find_angle(x,y);
//cout<<p<<endl;
//cout<<" "<<ang<<endl;
if(ang<=p && israd(x,y) && p!=0|| abs(ang-p)<=0.000001)
cout<<"Case #"<<t<<":"<<" "<<"black"<<endl;
else
cout<<"Case #"<<t<<":"<<" "<<"white"<<endl;
}
}