crowulll

Untitled

Aug 18th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. #include<iostream>
  2. #include<vector>
  3. #include<cmath>
  4. using namespace std;
  5. long long fr(int k){
  6.     for (long long i = k; i >=0; --i)
  7.         if (i*i <= k) return i;
  8. }
  9. int x, y;
  10. int main(){
  11.     cin >> x >> y;
  12.     int f = fr(x*x + y*y); bool is = false;
  13.     if (f*f == x*x + y*y) is = true;
  14.     if ((x > 0 && y > 0) || (x < 0 && y < 0)){
  15.         if (f % 2 == 0 && !is) cout << "black";
  16.         if (f % 2 == 1 && !is) cout << "white";
  17.     }
  18.     else if ((x > 0 && y < 0) || (x < 0 && y > 0)){
  19.         if (f % 2 == 1 && !is) cout << "black";
  20.         if (f % 2 == 0 && !is) cout << "white";
  21.     }
  22.     if (is) cout << "black";
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment