Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iomanip>
- #include <iostream>
- #include <functional>
- #include <algorithm>
- #include <math.h>
- #include <cmath>
- #include <string>
- #include <vector>
- #include<set>
- #include<map>
- #include <time.h>
- #include <fstream>
- using namespace std;
- typedef long long ll;
- typedef double d;
- typedef long long ll;
- int main()
- {
- int t;
- cin >> t;
- while (t)
- {t--;
- int x, g, y, r;
- cin >> x >> g >> y >> r;
- int loop = g + y + r;
- int c = x / (loop);
- //cout << c << endl;
- x = x - c*loop;
- if (x - g < 0){
- cout << "GREEN";
- }
- else if (x - g - y < 0){
- cout << "YELLOW";
- }
- else if (x - g - y - r < 0){
- cout << "RED";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement