jeff69

Untitled

Jan 9th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. typedef long double ld;
  4. const int MX=3e5+6;
  5. const ld pi =acos(-1);
  6. int p,x,y;
  7. int main()
  8. {
  9. freopen("progress_pie.txt","r",stdin);
  10. freopen("out.txt","w",stdout);
  11. int t;
  12. cin>>t;
  13. int g=0;
  14. while(t--){
  15. g++;
  16. cin>>p>>x>>y;
  17. printf("Case #%d: ",g);
  18. if((x-50)*(x-50)+(y-50)*(y-50)>50*50)
  19. {
  20. cout<<"white\n";
  21. continue;
  22. }
  23. ld th=atan2(x-50,y-50);
  24. if(th<0)th=pi-th;
  25. //cout<<th*180.0/pi<<endl;
  26. th/=2.0*pi;
  27. if(p>100.0*th)cout<<"black\n";
  28. else cout<<"white\n";
  29. // cout<<th;
  30. }
  31. return 0;
  32.  
  33. }
Add Comment
Please, Sign In to add comment