Language: C++

#include <bits/stdc++.h>
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define SORTR(v,n) sort(v, v+n, greater<int>());
#define SORTPairSecond(v, n) sort(v, v+n, pairCompareSecond);
#define int long long    // %d=>%lld, 1<<n  => 1LL<<n
#define pb push_back

using namespace std;
typedef long long ll;

typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> piii;
typedef pair<ll, pll> plll;
bool pairCompareSecond(const pii& firstEl, const pii& secondEl) {
    return firstEl.second > secondEl.second;
}

const ll MOD = 1000000007;
const int INF = 1000000007;
// const int INF = 0x3f3f3f3f;
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
// const ll LLINF = 1LL << 50;
const double PI = acos(-1);
const double EPS = 0.000000001;

int maxH = 500, maxW = 500, maxD = 1000;

int h, w, d;

char col[4] = ['R', 'Y', 'G', 'B'];

char ans[maxH][maxW];
char retu[2][maxD*4];

signed main(){
    ios::sync_with_stdio(0);
    cin >> h >>  w >>  d;

    for(int i = 0;i < 4;i++){
        for(int j = 0;j < d;j++){
            if(i%2 == 0){
                retu[0][i*d+j] = 'R';
                retu[1][i*d+j] = 'G';
            }else{
                retu[0][i*d+j] = 'Y';
                retu[1][i*d+j] = 'B';
            }
        }
    }

    if(d%2 != 0){
        for(int i = 0;i < h;i++){
            for(int j = 0;j < w;j++){
                if((i+j)%2 == 0){
                    ans[i][j] = col[0];
                }else{
                    ans[i][j] = col[1];
                }
            }
        }
        for(int i = 0;i < h;i++){
            for(int j = 0;j < w;j++){
                cout<< ans[i][j];
            }
            cout<< endl;
        }
        return 0;

    }else{
        int nc = 0;
        int cnt = 0;
        for(int i = 0;i < (h+(d/2)-1)/(d/2);i++){
            for(int j = 0;j < d/2;j++){
                for(int k = 0;k < w;k++){
                    if(i%2 == 0){
                        cout<< retu[0][j+k]
                    }else{
                        cout<< retu[1][d/2+j+k]
                    }
                }
                cout<< endl;
            }

        }
    }



    return 0;
}

Compiler output:
a.cc:33:16: error: expected identifier before 'R'
   33 | char col[4] = ['R', 'Y', 'G', 'B'];
      |                ^~~
a.cc:33:19: error: expected ']' before ',' token
   33 | char col[4] = ['R', 'Y', 'G', 'B'];
      |                   ^
      |                   ]
a.cc: In lambda function:
a.cc:33:19: error: expected '{' before ',' token
a.cc: At global scope:
a.cc:33:15: error: array must be initialized with a brace-enclosed initializer
   33 | char col[4] = ['R', 'Y', 'G', 'B'];
      |               ^~~~
a.cc:33:21: error: expected unqualified-id before 'Y'
   33 | char col[4] = ['R', 'Y', 'G', 'B'];
      |                     ^~~
a.cc:35:16: error: size of array 'ans' is not an integral constant-expression
   35 | char ans[maxH][maxW];
      |                ^~~~
a.cc:35:10: error: size of array 'ans' is not an integral constant-expression
   35 | char ans[maxH][maxW];
      |          ^~~~
a.cc:36:18: error: size of array 'retu' is not an integral constant-expression
   36 | char retu[2][maxD*4];
      |              ~~~~^~
a.cc: In function 'int main()':
a.cc:79:44: error: expected ';' before '}' token
   79 |                         cout<< retu[0][j+k]
      |                                            ^
      |                                            ;
   80 |                     }else{
      |                     ~                       
a.cc:81:48: error: expected ';' before '}' token
   81 |                         cout<< retu[1][d/2+j+k]
      |                                                ^
      |                                                ;
   82 |                     }
      |                     ~