Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. #include<iostream>
  2. #include<vector>
  3. #include<algorithm>
  4. #include<string>
  5. #include<set>
  6. #include<iterator>
  7. #include<map>
  8. #include<deque>
  9. #include<math.h>
  10. #include<numeric>
  11. #include<queue>
  12. #include<stack>
  13. #include<iomanip>
  14. #include<unordered_set>
  15. #include<chrono>
  16. #include<random>
  17.  
  18. #define int long long
  19. #define pb push_back
  20. const int MOD = 1e9 + 7;
  21. #define ld long double
  22. using namespace std;
  23.  
  24. mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
  25.  
  26. int32_t main() {
  27. ios_base::sync_with_stdio(false);
  28. cin.tie(0);
  29. //freopen("registration.in", "r", stdin);
  30. //freopen("registration.out", "w", stdout);
  31. int n, m, a, b, h;
  32. cin >> h >> n >> m >> a >> b;
  33. int mn = (m + b - 1) / b;
  34. int sc = (n + a - 1) / a;
  35. int k = max(mn, sc);
  36. if (n + 1 >= mn && n + 1 <= m){
  37. if (h == 0){
  38. cout << "YES";
  39. return 0;
  40. }
  41. cout << "YES\n";
  42. int q = m / (n + 1);
  43. for (int i = 0; i < n + 1; i++){
  44. for (int j = 0; j < q; j++){
  45. cout << "B";
  46. }
  47. if (i != n){
  48. cout << "G";
  49. }
  50. }
  51. for (int i = 0; i < m - q * (n + 1); i++){
  52. cout << "B";
  53. }
  54. return 0;
  55.  
  56. }
  57. if (sc - 1 >= mn && sc - 1 <= m){
  58. if (h == 0){
  59. cout << "YES";
  60. return 0;
  61. }
  62. else{
  63. cout << "YES\n";
  64. int q = m / (sc - 1);
  65. for (int i = 0; i < sc - 1; i++){
  66.  
  67. }
  68. }
  69. }
  70. if (k <= min(n, m)){
  71.  
  72. cout << "YES";
  73. return 0;
  74. }
  75. cout << "NO";
  76. return 0;
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement