QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#473278#8599. Кольорова таблицяQwerty1232#40 1ms3840kbC++232.8kb2024-07-12 00:07:592024-07-12 00:07:59

Judging History

你现在查看的是最新测评结果

  • [2024-07-12 00:07:59]
  • 评测
  • 测评结果:40
  • 用时:1ms
  • 内存:3840kb
  • [2024-07-12 00:07:59]
  • 提交

answer

#include <bits/stdc++.h>

std::vector<std::string> try_fuck(int n, int m, int q, std::vector<std::string> input) {
    int cnt = 0;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            char a0 = input[i][j];
            std::string s = "RGB";
            if (i > 0) {
                std::erase(s, input[i - 1][j]);
            }
            if (j > 0) {
                std::erase(s, input[i][j - 1]);
            }
            if (!std::count(s.begin(), s.end(), input[i][j])) {
                std::string s2 = s;
                if (j + 1 < m) {
                    std::erase(s2, input[i][j + 1]);
                } else {
                    if (i + 1 < n) {
                        std::erase(s2, input[i + 1][j]);
                    }
                }
                input[i][j] = s2.size() ? s2.front() : s.front();
            }
            cnt += input[i][j] != a0;
            // std::cout << input[i][j];
        }
        // std::cout << "\n";
    }
    if (cnt <= q) {
        return input;
    }
    return {};
}

int32_t main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);

    int n, m, c, q;
    std::cin >> n >> m >> c >> q;
    std::vector<std::string> input(n);
    for (auto& i : input) {
        std::cin >> i;
    }

    auto select = [&](int s, int i, int j) -> char {
        if (s < 6) {
            return "RGGBRB"[s / 2 * 2 + (s + i + j & 1)];
        }
        s -= 6;
        return "RGBBGR"[s / 3 * 3 + (s + i + j) % 3];
    };
    int suc = -1;
    for (int s = 0; s < 6 * 2; s++) {
        int cnt = 0;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                cnt += input[i][j] != select(s, i, j);
            }
        }
        if (cnt <= q) {
            suc = s;
            break;
        }
    }

    if (suc == -1) {
        assert(false);
        auto a = try_fuck(n, m, q, input);
        if (a.empty()) {
            std::vector<std::string> input2(m, std::string(n, '-'));
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    input2[j][i] = input[i][j];
                }
            }
            auto a2 = try_fuck(m, n, q, input2);
            if (a2.size()) {
                a = input;
                for (int i = 0; i < n; i++) {
                    for (int j = 0; j < m; j++) {
                        a[i][j] = a2[j][i];
                    }
                }
            }
        }
        for (auto s : a) {
            std::cout << s << "\n";
        }
        return 0;
    }

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            std::cout << select(suc, i, j);
        }
        std::cout << std::endl;
    }

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Runtime Error

Test #1:

score: 7
Accepted
time: 0ms
memory: 3776kb

input:

1 34
3 17
GGGRBGGBBGGBGBGBBRGGGRRRBBGGGBBRGB

output:

GBGBGBGBGBGBGBGBGBGBGBGBGBGBGBGBGB

result:

ok ok

Test #2:

score: -7
Runtime Error

input:

1 75
3 37
RBRBBBGGRGBGRBBGGRGBGGGGBRBRRGRGRBBRRRGBGGRBRRRRGBRBGGBGBRBBRRRRGRGBBRRBRBG

output:


result:


Subtask #2:

score: 7
Accepted

Test #31:

score: 7
Accepted
time: 0ms
memory: 3588kb

input:

1 78
2 39
GRGGGRGRGRRRRGGRRRRGRGRGRGGGRGRRRRRRRGGRRGGGGGRGRGGGGGRRGRGRGGGRRRGRGGGRRRRRGG

output:

GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR

result:

ok ok

Test #32:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

1 18
2 9
GGRGRRRRGRRRGRGRRG

output:

GRGRGRGRGRGRGRGRGR

result:

ok ok

Test #33:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

1 63
2 31
RGRRRRRRRGGGRGRRRGGGRRRRGGRRGRRGRGRGGRGGRGRRRGRGRRRRGRRRGGRRGRR

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR

result:

ok ok

Test #34:

score: 0
Accepted
time: 0ms
memory: 3484kb

input:

1 3
2 1
RGG

output:

RGR

result:

ok ok

Test #35:

score: 0
Accepted
time: 0ms
memory: 3772kb

input:

1 47
2 23
RRGRRRGGGRGGRRGGRGRRGRRRGGRRGRGGGGGGGRGRRRGGGGR

output:

GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG

result:

ok ok

Test #36:

score: 0
Accepted
time: 0ms
memory: 3780kb

input:

1 96
2 48
GRRGGRRGGRRGGGGGRRGRRGGGRRGRGGRRRGGRRRGGGGRGRGRGGRGGGGRGRGRRGRGGGRRRGGGRGRGGRGRGRRRRRRGRRGRGGGGR

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG

result:

ok ok

Test #37:

score: 0
Accepted
time: 0ms
memory: 3476kb

input:

1 44
2 22
GRRGGRRRRRRRRRRGRRGRRGRGGGGGGGGRGGGGRGRGRGGR

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG

result:

ok ok

Test #38:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

1 88
2 44
GGRRRRGRRGRGGGRGRGRRGRGGGRRGGRRRRGRRGRGRGRRRRGRRRGRRGRRGRRRRGRGGGRRRGRGRGRGGGGGGGRRRRRGG

output:

GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR

result:

ok ok

Test #39:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

1 29
2 14
RGGGGRGRRGRRRRGRRRRGRGRGRRRGR

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGR

result:

ok ok

Test #40:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

1 25
2 12
RRGGGGRRRRGGGGRGRRGGGRGGG

output:

GRGRGRGRGRGRGRGRGRGRGRGRG

result:

ok ok

Test #41:

score: 0
Accepted
time: 0ms
memory: 3812kb

input:

1 73
2 36
RRGGRGGRGRRRRRGGRRGGRGRGGRGGGRGRGGGRRRGGRRGRRRRRRGGGRGGGGGGRGRGGGRRRRGRGR

output:

GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG

result:

ok ok

Test #42:

score: 0
Accepted
time: 0ms
memory: 3544kb

input:

1 22
2 11
RGRRGGGRGGRRGGGRRGRGRR

output:

RGRGRGRGRGRGRGRGRGRGRG

result:

ok ok

Test #43:

score: 0
Accepted
time: 0ms
memory: 3576kb

input:

1 66
2 33
GGRGGGRGRGRGRGRRRRRGGRRRGRGGRGGGGRRRGGGRRGRRGRRGRRRGRRGGGRRRRRRGGR

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG

result:

ok ok

Test #44:

score: 0
Accepted
time: 0ms
memory: 3528kb

input:

1 10
2 5
GRGRRGRGRG

output:

RGRGRGRGRG

result:

ok ok

Test #45:

score: 0
Accepted
time: 0ms
memory: 3520kb

input:

1 51
2 25
GRGGGGGGGRGGRGGRRGGRGRRRGRRRRRGGRRRRGGRGRGGGRRRGGRR

output:

GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG

result:

ok ok

Test #46:

score: 0
Accepted
time: 0ms
memory: 3804kb

input:

1 99
2 49
RRRGRGRGGRGGGRGGRRRRGGGRRGGRRRRRGRRGRGGRGRRRRRRGGRGRGGGRRRRGGGGGRGGRRRRRGRGGGRGRRGGGGGRGRGGGRGRRGGR

output:

GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG

result:

ok ok

Test #47:

score: 0
Accepted
time: 0ms
memory: 3520kb

input:

1 39
2 19
RGRRRGRRGRGRRGRGRGGRRRRGRRGRRRRRRRGRRRR

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR

result:

ok ok

Test #48:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

1 92
2 46
RGRGGGGRRGRGGRRGRRGGGRGGGGGGRGGRGRGGGGGGGGRRGRRGRGRGGRGGRGRGGGRRRRGRRGRGGRRRGRRGGGRGRRRRRRRR

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG

result:

ok ok

Test #49:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

1 36
2 18
GGGRRGGRRGRRRGRGRRRGGGRGRRRGGGRGGGGG

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG

result:

ok ok

Test #50:

score: 0
Accepted
time: 0ms
memory: 3780kb

input:

1 15
2 7
GRRGGRGRGRRRGGG

output:

GRGRGRGRGRGRGRG

result:

ok ok

Test #51:

score: 0
Accepted
time: 0ms
memory: 3528kb

input:

1 59
2 29
RRGRGRGRRRGGRRGGGRGGRGGGGRGGGRRGRRRGGGRRGGRGGGGGGGRRRGGGRGR

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR

result:

ok ok

Test #52:

score: 0
Accepted
time: 0ms
memory: 3524kb

input:

1 99
2 49
RRGGRRRGRRGGGGRGGGGGGRRGRGRGGRGGGRRRRRGRRRRGRGGRGGGRRRRRGGRGGGGGRRGGRGGGRRGGGRGGRGRGGRRGRRGGGRRRGGR

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR

result:

ok ok

Test #53:

score: 0
Accepted
time: 0ms
memory: 3540kb

input:

1 52
2 26
RGGRGRGGGGGRRRRRGRRGGGGGGRRRGRRGRRRGRGRGGRGGRGGRRGRG

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG

result:

ok ok

Test #54:

score: 0
Accepted
time: 0ms
memory: 3480kb

input:

1 96
2 48
GGRRGRGGGGGGGGRRGGGGRRRRGGRRGGGRGRRRGGRGRGRRRGGGRGRGGRGRRGRRRGGRGGRGRRGRGRGGGRRRRRRGRGRRRGGGGRRG

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG

result:

ok ok

Test #55:

score: 0
Accepted
time: 0ms
memory: 3748kb

input:

1 40
2 20
GGRGRRRRGGRRRRGRGGGRGRGRRRGRGGRRGGGGGRGR

output:

GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR

result:

ok ok

Test #56:

score: 0
Accepted
time: 0ms
memory: 3812kb

input:

1 85
2 42
GRGRGRRRRRRRGGGRGRRRGGRRGGGGRRGRRGGRGGRRRRGGGGGRRRRRGGGRRRGRRGGRGGRGGRGRGRRRRGGRGRRGR

output:

GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG

result:

ok ok

Test #57:

score: 0
Accepted
time: 0ms
memory: 3816kb

input:

1 25
2 12
RRGGRRGRRRRGRRRRGGRRRRGRR

output:

GRGRGRGRGRGRGRGRGRGRGRGRG

result:

ok ok

Test #58:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

1 70
2 35
RGRRRRGRGRGRGRRGGRGRGGRGGRRGRRRGRGGRRRGGRGGGRGGRGRGRGRGRRRGRRRRGGRRGGG

output:

GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR

result:

ok ok

Test #59:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

1 26
2 13
RGRRGRRGGGGGRGGGRRGGGGGGRG

output:

RGRGRGRGRGRGRGRGRGRGRGRGRG

result:

ok ok

Test #60:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

1 100
2 50
GGGRRGRRRGGGRGGRRGRRGGRRGRGGRGRGGGRRRRRRRGRGRRRGRRRGRGRGGRRRRGGGGGRRGGRGRGGGRGGRRGRGRGRGGRGGRRRGRGRG

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG

result:

ok ok

Subtask #3:

score: 3
Accepted

Test #61:

score: 3
Accepted
time: 0ms
memory: 3788kb

input:

79 100
3 7900
RRRRBBGGGRGRGRGRGGGGRBBRRRGBRGRGRBBRGGBRRBBRGRGRBBBRGRBBRBBBRGGBGGRBGBBGGGBRGBRRGBBBGGGGRGGGRGRGBBGG
RGBRBGGGGGRBGRGBGGBGRBRBBRBBRRGRGGGBRRBRGRGBBBBRGGGGBGGRGGGGRRBRGRRGGRRBGBGBBGRRGBRBRBBGGRGBRGBRRBRR
RBRRGGBGRRGRGGRRRBGGBRRRRGBRRGBGBBBBRBRBBRBRGRBBGRGRBGGBBRGBGRGBRGRRGRRRRRRBRRRGBBBB...

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
RGRGRGRG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RBRBR...

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
...

result:

ok ok

Test #66:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

3 26
3 78
BGRBBRGRRGGGRGRRRRBBGBRBRG
RRBRBBBGRBBBBRRBRGRRBRGRBR
RBGRGBBBRRRBRBBRBBBRRBGGGB

output:

RGRGRGRGRGRGRGRGRGRGRGRGRG
GRGRGRGRGRGRGRGRGRGRGRGRGR
RGRGRGRGRGRGRGRGRGRGRGRGRG

result:

ok ok

Test #67:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

31 71
3 2201
RBGRRBGRRGRRRGBBGRBRRGBRRRGBGGGGGGRGRRBRGRGGRGGBRBGBRRBRRBRGGGGRGBGBGBG
BGGGRGBGBBBGRBBRRBBRRGGBBBGGRBRGGRGBGBRRGBRBGGRBGGGRBRGBBBBBGBGBGGBGBRB
GGRBGGRRRBBRRGBGBGGGRRRRBGRGBRGGBGBGGGGRRBGGBRRGGBRRRRRRBBGRGGGBBGBRGGG
RBGRGRRRRRRGGBBRGBRRBBGGGRRGBRBRGBBGBGBBGGBGRGBBRGGBBGRRGGRBBRBGGRRBBRB...

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
RGRGRGRG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RGRGRGRGRGR
...

result:

ok ok

Test #79:

score: 0
Accepted
time: 0ms
memory: 3776kb

input:

52 59
3 3068
RRGRRBGGRGRRRRBBGRRBBRRRRGGBRRRRRBRBBBRGGBGBGGGRBBGRGBRGBGR
BGGGBRBGGBBGBRBRRBBGRGGRRBBRBRBRRGBGGBRRGGBRGRGGBBRRGRGGGBB
BRRGRRRGGBGRRBRGRBRRRBRBRRBGBGGBRBBBRRBGBBGBGBGRRGRBBBRGRRR
RRBGRGGRBRGBBGGBRBRGRBRGGGBGBBRRGGBGGRBGBBRGBGRGGGGGGRGBGRG
GGRBRBGRBBBRGRRGBBBBBRGBRBRGGBRBRRGBBBRRGRBBRGB...

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
...

result:

ok ok

Test #80:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

39 41
3 1599
RBBGBBBRRBRGGGBBGRGBBBBGBBRRRBBRBRRRBRRRR
BBBGBBGRBRBRBGBGGGRBGRBBBRBGGBRGRBBGRGBBG
RBBGRGBGGGBRGRBRRRRRRRBGRBBBBGGGBRGRGGRGG
BBRRBRBRGBRGBGGBBBRGRGBGBGGBBBBGRGBBGBRRG
GRGGRGBBRRRRBRBBGRRRGGBRGBBGBBGRGGBBRRGRR
BRRBGRRBGGGRGRRBRRGGBRGBBRBBGRGBBBGGRBBRR
RGRGBBGRGBRBGRGGRGRGBBRGGBBRRGGBRRR...

output:

RGRGRGRGRGRGRGRGRGRG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BRBBBBBBGG
GBRBBBGGGBGGRBGBRBRRBBBBBGG
RBBBBBBGGGBBRBGBGGBBBBBGGRG
BGGBGGRBBGRBBGRGGGGBBRGBRBG
RBGGBGRGGGBBRGBGRRRRRBGRGGB
BGRGGGR...

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGR
GRGRGRGRGRGRGRGRGRGRGRGRGRG
RGRGRGRGRGRGRGRGRGRGRGRGRGR
GRGRGRGRGRGRGRGRGRGRGRGRGRG
RGRGRGRGRGRGRGRGRGRGRGRGRGR
GRGRGRGRGRGRGRGRGRGRGRGRGRG
RGRGRGRGRGRGRGRGRGRGRGRGRGR
GRGRGRGRGRGRGRGRGRGRGRGRGRG
RGRGRGRGRGRGRGRGRGRGRGRGRGR
GRGRGRGRGRGRGRGRGRGRGRGRGRG
RGRGRGRGRGRGRGRGRGRG...

result:

ok ok

Subtask #4:

score: 0
Runtime Error

Test #91:

score: 0
Runtime Error

input:

8 69
3 276
RGRBGRBRBRBRBGBRBRBRGRBRGRGRGRGRBRBGBRBGBGRBRGBGRBGBRGRGBRBGBGBGBRBRG
RGRBGRBRBRBRBGBRBRBRGRBRGRGRGRGRBRBGBRBGBGRBRGBGRBGBRGRGBRBGBGBGBRBRG
RGRBGRBRBRBRBGBRBRBRGRBRGRGRGRGRBRBGBRBGBGRBRGBGRBGBRGRGBRBGBGBGBRBRG
RGRBGRBRBRBRBGBRBRBRGRBRGRGRGRGRBRBGBRBGBGRBRGBGRBGBRGRGBRBGBGBGBRBRG
RGRBGRBRB...

output:


result:


Subtask #5:

score: 0
Runtime Error

Test #121:

score: 0
Runtime Error

input:

9 68
3 306
GBRBGRBGGGRBRRRRBBGRBGRBBBRBRBBRRRBRRRBBRBRGBBGGGGBRGBBGBBRRRGBGBGBR
GBRBGRBGGGRBRRRRBBGRBGRBBBRBRBBRRRBRRRBBRBRGBBGGGGBRGBBGBBRRRGBGBGBR
GBRBGRBGGGRBRRRRBBGRBGRBBBRBRBBRRRBRRRBBRBRGBBGGGGBRGBBGBBRRRGBGBGBR
GBRBGRBGGGRBRRRRBBGRBGRBBBRBRBBRRRBRRRBBRBRGBBGGGGBRGBBGBBRRRGBGBGBR
GBRBGRBGGGRBR...

output:


result:


Subtask #6:

score: 13
Accepted

Test #151:

score: 13
Accepted
time: 0ms
memory: 3808kb

input:

4 10
3 26
BGGRRBBRBG
BGBGGBGRRB
RBBBBBRGGR
RGRBGGRGBB

output:

GRGRGRGRGR
RGRGRGRGRG
GRGRGRGRGR
RGRGRGRGRG

result:

ok ok

Test #152:

score: 0
Accepted
time: 0ms
memory: 3524kb

input:

32 55
3 1173
GBBBGBRRBGBGRGRGBRGBRRGGBGRGBRBRGRGGGGGRGGGGGGGGBRBRRGR
BRRRRBBBBGBBGGRRRBGBBGGGBGGGGBRRGBBGBGGRGBGRBGBBBRBGRGG
RGRBRBRRRGBRBRRRGRGBBGBRGGGRRGRRGGBBBGRBRBBRGGGGGGGBGGR
GBRGRBBRRBGGBRBGBGGGGGBGBGBGBGBGRRBBRBBRGRGGRRRGGRGRGBB
GRBBBGBBRGRRRGRGRGGRBBRRBRRBBRRGGGBBGRRBGRBRGBRRGRRRGGG
RRBGBGR...

output:

GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
RGRGRGRGRGRGRGRGRGRG...

result:

ok ok

Test #153:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

60 99
3 3960
RGRRGRGBBRRGBGRBRRGRGGRGGBRRBRGGBRBRBBRRRRGBGBBGBRRBRGGBGRRRR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GBBBRRBB...

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
RGRGRGRGRGRGRGRGRGRG...

result:

ok ok

Test #160:

score: 0
Accepted
time: 0ms
memory: 3536kb

input:

50 79
3 2633
RRGGRRRBRRGGBBBBRGRRGRGRBRBGRGGGRRRBGBGBGBGBBRGBBBBRBBBGGRBGBGBBRRBBBBRGRGGRRRR
GBBBBBRRGGRGGGRGGGGRRBGRGGRBRGGGGBRBBGGRRBRBGBGGBGBBBGGBGGGGBRGRRGBBBRBRBGBRRGB
BRBGRGGBRRRRBBGBGGRBGRBRBGBBRGGRBRBBGGBRRBRGRRRRBGRGRRBBGGBGRGBGRRGBBGRGRRGRBBG
RGBRRBGRGBRGRRRGGRBGRBGGRRGRGRGGRGRRGGRGRGGGGGR...

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR...

result:

ok ok

Test #161:

score: 0
Accepted
time: 0ms
memory: 3540kb

input:

74 20
3 986
GRGBBRRRBGGR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RRRGBR
RRGRBRGRRGBBB...

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
GRGRGRGRGRGRGRGRGRGRGRGRG...

result:

ok ok

Test #173:

score: 0
Accepted
time: 0ms
memory: 3536kb

input:

37 98
3 2417
RRBRRRRGRGRBRBGRRRBGRGGGRBRGGRGBRGGBGGRBBGGGBRRGBRBRGBRBGRRRRBGBGGRBGRRBBRGBRRGGRGRGGBGBRBBRGRBRBR
BGRBGRRRGBRRRBBGGBBBGRGBRRRGRGRRRBRGBBRRRGGRBGRBBBRGGGGBRGRBRGGBGBBBRRRBGBRGGRRRBBRGGGBRGRGGRGRBRR
BBBRGRBBRGBBBBBRGBGBGRGBBRGRBGRRRRGBBRRRGBGGGRGGBRBBBGBBRRBBBRBGGGBRRRRGRGGGGGBBGRGRGGGBG...

output:

GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
RGR...

result:

ok ok

Test #174:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

65 38
3 1646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BRGGRGBGGBBRRGRRBRBG
GGRGRBRRBBRGBGGRBGRBRGBRRRRGBGGGBGGRBRGGRBRGBGR...

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
RGRGRGRGRGRG...

result:

ok ok

Subtask #7:

score: 0
Runtime Error

Test #181:

score: 0
Runtime Error

input:

4 52
3 104
GRRGGGGBGRRBRGBRGRGRRBGBGBBRGGRRBBGBGBGBGGBRRRRBRRRG
RGBGGGRGBGRBGRRBBBBRGRRBBBBGGBRGRBBRGGRBRGBRBGRBBGGR
RBRGBGBGGRBBGGGRRRRBBRGRRGGBRGGRGRRGBRRRGRRBRGRGRBGG
GRBBRRRRGGBRBBBGBBGGBRRGRGGBGGBRRGBRBBRRBGGBGBBBRRRR

output:


result:


Subtask #8:

score: 17
Accepted

Test #211:

score: 17
Accepted
time: 0ms
memory: 3536kb

input:

42 54
2 1134
GGRRGGGGGGGGRRGGRRRGGGRRGRRGGGGGGRRGGGGGGGGGGRGGRRRGRG
RRRGGGRGGGRRRGGRRRRRRGGRGRGRGGRGGGRGRGRRGRRGGRGRRGGRRR
RGGGRGRGGGRGGGGGRGGRGRGGGGGGGGGRRRGRRGGGRRGRGRGGGGGGRG
RRGRGRRRRRRGGGGGGGRGGGRRRRGRGGRRGGGRGRRRRRGRRGRGRGGRGG
GRGRGRGGGGGGGGRGGGGRGRRGRGRGGGGRGGRRGRRRGRRGRRRRRGGRRG
RGGRRRGGGRGG...

output:

GRGRGRGRGRGRGRGRGRGR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
RRRRRGRRGGRRG
GRRGGGRR...

output:

GRGRGRGRGRGRG
RGRGRGRGRGRGR
GRGRGRGRGRGRG
RGRGRGRGRGRGR
GRGRGRGRGRGRG
RGRGRGRGRGRGR
GRGRGRGRGRGRG
RGRGRGRGRGRGR
GRGRGRGRGRGRG
RGRGRGRGRGRGR
GRGRGRGRGRGRG
RGRGRGRGRGRGR
GRGRGRGRGRGRG
RGRGRGRGRGRGR
GRGRGRGRGRGRG
RGRGRGRGRGRGR
GRGRGRGRGRGRG
RGRGRGRGRGRGR
GRGRGRGRGRGRG
RGRGRGRGRGRGR
GRGRGRGRGRGRG
RGRGRG...

result:

ok ok

Test #220:

score: 0
Accepted
time: 0ms
memory: 3528kb

input:

4 80
2 160
RRRRGRRRGRGGGGGRRRRGGGGRRRRGRGGRGRGRGRRGRRGRGRGRGGGRGRRRGRGGRGRRRRRRRGGRGRGRRRGG
RRRGRRGRRGGRGGRRGRGGGRRRGGGRGGGGRGGRGRRGRGRGRRGGGRRRRGGRRRGRRGGRRRRRRGGRGGRGRGGG
GGRGGGGRRGRGGGRRRRRRRGGRGRGRGRRRGRGRGRGGGGGGGGGRRRRGRRGGRRRRGGGGGGGGGRGGGRRRGRRR
RGRGRGGGRGGRGGRGRGRGGRGRRRGRGRGGGGRRRRRGGRRGRG...

output:

GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR...

result:

ok ok

Test #221:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

28 24
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ok ok

Test #228:

score: 0
Accepted
time: 0ms
memory: 3820kb

input:

4 35
2 70
GGGGGRGRRGRGGRGRGRRRGRGRGRGGGRGGGGG
RGRRGRGGGGRGRGGGRRGRRGGRRRGRGGGGGRR
RRRRRRRGGGGRGRGRRRGGGRGGRGGRRRGRGRG
GRRGRRRRRRGRRRGRGGRRGGGRGGGRRGGGRGG

output:

GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR

result:

ok ok

Test #229:

score: 0
Accepted
time: 0ms
memory: 3784kb

input:

28 79
2 1106
GGGRRRGRRRRRRGGRGGGRGRRRRGGGGRGGRGGGGRGGGRGGGRGGGGRGRRGGRRGRGGGRRGRGGRGRGRRRGGR
GRRRRRGRGGRGGRGRRGRGRRGRRGRRRGGRGRGGGRGGRRGGRRGGGRRGRGGRRRGGRGGRGGGRGGGRGGRGRGG
GGRRRRRRGGGGRRGRRGRRRGRRRGRRRGRGGGRRGGGGRRRGRRGGRGRRGRGRGRGGGRRRGRRRRRGGRGGRGGG
RRGGRGGRRRRRGRGGRGRRRGGGRGGGRGRGRRGGGGGRGGRGGGR...

output:

GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG...

result:

ok ok

Test #230:

score: 0
Accepted
time: 0ms
memory: 3592kb

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RGRGRGRGRGRGRGRGRGRGRG
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG...

result:

ok ok

Test #240:

score: 0
Accepted
time: 1ms
memory: 3840kb

input:

100 100
2 5000
GGGGGGGGGGGGRRRRGGGGRRRRGGGGGGGGRRRRRRRRRRRRRRRRGGGGGGGGRRRRGGGGGGGGGGGGRRRRGGGGGGGGGGGGRRRRRRRRGGGG
GGGGGGGGGGGGRRRRGGGGRRRRGGGGGGGGRRRRRRRRRRRRRRRRGGGGGGGGRRRRGGGGGGGGGGGGRRRRGGGGGGGGGGGGRRRRRRRRGGGG
GGGGGGGGGGGGRRRRGGGGRRRRGGGGGGGGRRRRRRRRRRRRRRRRGGGGGGGGRRRRGGGGGGGGGGGGRRRRGGGGGGG...

output:

RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG
GRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGR
RGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRGRG...

result:

ok ok

Subtask #9:

score: 0
Runtime Error

Test #241:

score: 0
Runtime Error

input:

68 15
3 510
RRBGRGBBRBRGGGR
GBRRRBBGBRBGBGR
RGGGRBBBGGGGGBG
BRRBRGRRGBRBGRR
BRBBGBRBBRRRRRB
GRRGGGGGGGGGGBR
RBBRRBGRRRGRGRG
GRGGGGRGRRGRRRB
GGBRGBRBRRBRRBG
RGRGBBBGGRGGRGB
BRRGBGRGRGBGBBG
GGRRBBBGRBRBBGB
GBBRBBBBBBRRGBG
BRBGGBBBRRBGGGB
BBGGRBGBRRRBRBG
BGGGBRRBRRGGRBG
RRRBBBGRRBBBBRB
GGRRRGRGGGBBRGB
...

output:


result: