Advertisement
jeff69

Untitled

Mar 26th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include <iomanip>
  2. #include <iostream>
  3. #include <functional>
  4. #include <algorithm>
  5. #include <math.h>
  6. #include <cmath>
  7. #include <string>
  8. #include <vector>
  9. #include<set>
  10. #include<map>
  11. #include <time.h>
  12. #include <fstream>
  13. using namespace std;
  14. typedef long long ll;
  15.  
  16. typedef double d;
  17. typedef long long ll;
  18. int main()
  19. {
  20.  
  21. int t;
  22. cin >> t;
  23. while (t)
  24. {t--;
  25.  
  26.  
  27. int x, g, y, r;
  28. cin >> x >> g >> y >> r;
  29. int loop = g + y + r;
  30. int c = x / (loop);
  31. //cout << c << endl;
  32. x = x - c*loop;
  33. if (x - g < 0){
  34. cout << "GREEN";
  35.  
  36. }
  37. else if (x - g - y < 0){
  38. cout << "YELLOW";
  39.  
  40. }
  41. else if (x - g - y - r < 0){
  42. cout << "RED";
  43.  
  44. }
  45.  
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement