Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<vector>
- #include<cmath>
- using namespace std;
- long long fr(int k){
- for (long long i = k; i >=0; --i)
- if (i*i <= k) return i;
- }
- int x, y;
- int main(){
- cin >> x >> y;
- int f = fr(x*x + y*y); bool is = false;
- if (f*f == x*x + y*y) is = true;
- if ((x > 0 && y > 0) || (x < 0 && y < 0)){
- if (f % 2 == 0 && !is) cout << "black";
- if (f % 2 == 1 && !is) cout << "white";
- }
- else if ((x > 0 && y < 0) || (x < 0 && y > 0)){
- if (f % 2 == 1 && !is) cout << "black";
- if (f % 2 == 0 && !is) cout << "white";
- }
- if (is) cout << "black";
- }
Advertisement
Add Comment
Please, Sign In to add comment