Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<vector>
- #include<algorithm>
- #include<string>
- #include<set>
- #include<iterator>
- #include<map>
- #include<deque>
- #include<math.h>
- #include<numeric>
- #include<queue>
- #include<stack>
- #include<iomanip>
- #include<unordered_set>
- #include<chrono>
- #include<random>
- #define int long long
- #define pb push_back
- const int MOD = 1e9 + 7;
- #define ld long double
- using namespace std;
- mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
- int32_t main() {
- ios_base::sync_with_stdio(false);
- cin.tie(0);
- //freopen("registration.in", "r", stdin);
- //freopen("registration.out", "w", stdout);
- int n, m, a, b, h;
- cin >> h >> n >> m >> a >> b;
- int mn = (m + b - 1) / b;
- int sc = (n + a - 1) / a;
- int k = max(mn, sc);
- if (n + 1 >= mn && n + 1 <= m){
- if (h == 0){
- cout << "YES";
- return 0;
- }
- cout << "YES\n";
- int q = m / (n + 1);
- for (int i = 0; i < n + 1; i++){
- for (int j = 0; j < q; j++){
- cout << "B";
- }
- if (i != n){
- cout << "G";
- }
- }
- for (int i = 0; i < m - q * (n + 1); i++){
- cout << "B";
- }
- return 0;
- }
- if (sc - 1 >= mn && sc - 1 <= m){
- if (h == 0){
- cout << "YES";
- return 0;
- }
- else{
- cout << "YES\n";
- int q = m / (sc - 1);
- for (int i = 0; i < sc - 1; i++){
- }
- }
- }
- if (k <= min(n, m)){
- cout << "YES";
- return 0;
- }
- cout << "NO";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement