Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define task "PAINTING"
- #include <iostream>
- #include <cstdio>
- using namespace std;
- using ll = long long;
- using ld = long double;
- constexpr int N = 1e5 + 5;
- int n, q;
- void Read()
- {
- cin >> n >> q;
- }
- void Solve()
- {
- while (q--)
- {
- int x, y;
- cin >> x >> y;
- if (x * 2 > n)
- x = n - x + 1;
- if (y * 2 > n)
- y = n - y + 1;
- int ans = (y <= x) ? (y % 3) : (x % 3);
- if (ans == 1)
- cout << "RED\n";
- else if (ans == 2)
- cout << "BLUE\n";
- else
- cout << "YELLOW\n";
- }
- }
- int32_t main()
- {
- ios::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- if (fopen(task ".INP", "r"))
- {
- freopen(task ".INP", "r", stdin);
- freopen(task ".OUT", "w", stdout);
- }
- Read();
- Solve();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement