QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#307397#8128. Alternating Pathsucup-team003#WA 39ms4264kbC++176.4kb2024-01-18 15:04:282024-01-18 15:04:30

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 4036kb

input:

3
6 6
1 2
2 3
3 1
4 1
5 2
6 3
6 6
1 2
2 3
3 1
3 4
4 5
4 6
4 3
1 2
4 2
2 3

output:

RRRBBB
RBBRBB
IMPOSSIBLE

result:

ok ok (3 test cases)

Test #2:

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

input:

1
4 6
1 2
1 3
1 4
2 3
2 4
3 4

output:

RRBRRR

result:

ok ok (1 test case)

Test #3:

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

input:

1
5 6
1 2
1 3
1 5
2 4
2 5
3 4

output:

RBRBRR

result:

ok ok (1 test case)

Test #4:

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

input:

1
5 8
1 2
1 4
1 5
2 3
2 4
2 5
3 4
4 5

output:

RRBBRRRB

result:

ok ok (1 test case)

Test #5:

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

input:

1
7 12
1 2
1 3
1 6
2 3
2 5
2 7
3 4
3 5
3 6
4 6
4 7
5 7

output:

RRBRRBBBRRRB

result:

ok ok (1 test case)

Test #6:

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

input:

1
7 13
1 2
1 3
1 4
1 6
1 7
2 5
3 5
3 7
4 6
4 7
5 6
5 7
6 7

output:

BRBRRRBRRRBRB

result:

ok ok (1 test case)

Test #7:

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

input:

1
4 5
1 2
1 3
1 4
2 3
2 4

output:

RRBRR

result:

ok ok (1 test case)

Test #8:

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

input:

1
5 7
1 2
1 4
2 3
2 4
3 4
3 5
4 5

output:

RRBRRRB

result:

ok ok (1 test case)

Test #9:

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

input:

1
5 7
1 2
1 5
2 3
2 5
3 4
3 5
4 5

output:

RRBRRRB

result:

ok ok (1 test case)

Test #10:

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

input:

1
6 6
1 2
1 4
2 3
2 6
3 5
4 5

output:

RRBRRB

result:

ok ok (1 test case)

Test #11:

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

input:

1
6 10
1 2
1 3
1 5
1 6
2 4
3 4
3 5
3 6
4 5
4 6

output:

BRRBRBRRRB

result:

ok ok (1 test case)

Test #12:

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

input:

1
9 14
1 2
1 5
1 8
2 3
2 4
3 6
3 9
4 6
4 7
4 8
5 7
5 8
6 8
7 8

output:

BRRRBBBRBBRRBR

result:

ok ok (1 test case)

Test #13:

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

input:

1
7 12
1 2
1 3
1 4
1 6
1 7
2 5
2 7
3 4
3 6
3 7
4 5
5 6

output:

RBBRRRRRBRRB

result:

ok ok (1 test case)

Test #14:

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

input:

1000
2 1
2 1
2 1
1 2
2 1
2 1
2 1
2 1
2 1
1 2
2 1
1 2
2 1
1 2
2 1
1 2
2 1
1 2
2 1
1 2
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
1 2
2 1
1 2
2 1
2 1
2 1
1 2
2 1
1 2
2 1
2 1
2 1
1 2
2 1
2 1
2 1
1 2
2 1
2 1
2 1
1 2
2 1
1 2
2 1
2 1
2 1
1 2
2 1
1 2
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1...

output:

R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
...

result:

ok ok (1000 test cases)

Test #15:

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

input:

1000
2 1
1 2
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
1 2
2 1
2 1
2 1
1 2
2 1
1 2
2 1
1 2
2 1
2 1
2 1
1 2
2 1
2 1
2 1
2 1
2 1
1 2
2 1
2 1
2 1
1 2
2 1
1 2
2 1
2 1
2 1
2 1
2 1
1 2
2 1
1 2
2 1
1 2
2 1
2 1
2 1
1 2
2 1
2 1
2 1
1 2
2 1
1 2
2 1
1 2
2 1
2 1
2 1
1 2
2 1
2 1
2 1
2 1
2 1
1 2
2 1
1 2...

output:

R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
...

result:

ok ok (1000 test cases)

Test #16:

score: 0
Accepted
time: 8ms
memory: 3956kb

input:

1000
3 3
2 1
1 3
3 2
3 2
3 1
3 2
3 3
2 3
2 1
3 1
3 2
2 1
3 2
3 3
2 3
3 1
1 2
3 3
1 3
2 1
2 3
3 3
2 1
3 2
3 1
3 3
1 3
1 2
3 2
3 3
3 1
2 1
3 2
3 3
1 3
1 2
3 2
3 2
3 1
1 2
3 3
3 2
1 3
1 2
3 2
3 1
2 1
3 3
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BR
BR
RRR
RB
RRR
RRR
RRR
RRR
RRR
RB
...

result:

ok ok (1000 test cases)

Test #18:

score: 0
Accepted
time: 10ms
memory: 4028kb

input:

1000
4 4
2 1
4 2
3 2
1 3
4 4
2 1
1 4
2 4
2 3
4 5
1 3
2 4
1 2
1 4
3 2
4 3
3 4
1 4
4 2
4 6
1 4
3 1
4 2
1 2
4 3
3 2
4 3
1 3
4 3
2 3
4 3
3 2
4 2
2 1
4 5
1 3
2 4
4 3
2 3
1 4
4 4
1 4
3 2
3 4
2 1
4 6
3 4
4 2
2 1
4 1
1 3
3 2
4 6
4 2
1 4
2 3
4 3
2 1
3 1
4 6
4 1
3 4
3 2
3 1
2 1
4 2
4 6
4 1
2 4
2 1
1 3
3 2
3 4...

output:

RBRR
RRRB
RRRBR
IMPOSSIBLE
BRRRRR
IMPOSSIBLE
IMPOSSIBLE
RRRBR
BBRB
RRRBRR
RBRRRR
BRRRRR
BRRRRR
RRRB
BRR
RRRRRB
RRRB
RBRR
RBR
BRRRR
RRRBR
RRRB
RRBRRR
RRBRR
RRB
RRBRRR
BRRRRR
BRRRRR
RBRRRR
RRBRR
RBRRRR
BRRRR
BRR
IMPOSSIBLE
RRRB
RBRR
BRR
RRRB
RRRBRR
IMPOSSIBLE
BRR
RBRRR
IMPOSSIBLE
IMPOSSIBLE
RBRRRR
RRB...

result:

ok ok (1000 test cases)

Test #19:

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

input:

1000
4 6
4 2
4 1
3 4
3 1
1 2
3 2
4 3
4 2
3 2
1 3
4 6
4 3
1 2
2 3
1 3
2 4
4 1
4 4
2 1
3 1
4 1
3 2
4 5
2 4
1 2
1 3
4 1
3 2
4 3
2 3
2 4
1 4
4 4
1 2
3 2
1 4
2 4
4 5
2 1
1 3
3 2
4 1
4 2
4 4
1 2
4 2
3 2
4 1
4 6
2 4
3 4
3 2
3 1
4 1
1 2
4 3
1 3
2 4
3 2
4 6
4 3
4 1
2 1
4 2
3 1
3 2
4 4
1 2
4 3
1 3
2 3
4 6
3 2...

output:

RBRRRR
RBR
RRRRRB
RRBR
RRRBR
RBR
RBRR
RRRBR
RRBR
RRRRBR
RRB
RBRRRR
RBRR
RRRBRR
RBRRR
IMPOSSIBLE
RBRRRR
RRRB
RRRRB
RRBRR
RBR
RRRRB
BRRRRR
RBRRR
RRRRBR
RRRRB
RRRBR
RBRR
RBRRRR
BBBR
RRBRRR
BRRR
RRRBRR
RBR
RRBRR
IMPOSSIBLE
RBRRR
RBRR
RRRRBR
BRRR
RRBR
BRRRRR
BRR
RRRBR
BRRRRR
RRB
IMPOSSIBLE
RRRB
RBR
RRRBR...

result:

ok ok (1000 test cases)

Test #20:

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

input:

1000
5 8
5 1
4 5
2 4
3 2
2 1
5 3
1 3
3 4
5 9
2 4
4 5
5 2
1 5
3 1
3 5
4 1
4 3
1 2
5 5
1 4
3 1
1 5
5 2
4 2
5 9
1 2
5 4
4 3
4 2
4 1
5 3
1 5
5 2
2 3
5 9
3 4
3 2
2 5
3 1
4 5
5 3
4 1
1 5
4 2
5 10
3 5
2 1
2 5
5 4
1 3
4 2
1 4
5 1
2 3
4 3
5 5
3 4
5 3
5 1
5 4
2 5
5 6
1 2
2 4
1 5
3 2
3 1
3 4
5 8
4 2
4 3
1 2
1 ...

output:

BRBRRRRB
RRBBRRRBR
BRRBR
RRBRRRBBR
RBRRBRRBR
BRRRRBBBRR
BRBRB
RBBRRR
RRRBRRRB
BRRB
BBRRBRBRR
BRRRR
RRBBRB
RBBRR
RRRBRBBBRR
BRBRB
RBRRRRBRB
RRRRBR
RRRRRB
RRRBBRBBRR
IMPOSSIBLE
RBRRBRR
RRBBBR
RRBBRBRRRB
RBRRRBRRB
IMPOSSIBLE
RRBBRBRRBR
RRBRRBRR
RRRRBBRBBR
IMPOSSIBLE
RBRRBRRRBB
RRBRBRRBR
BRRBRRRBR
BRRRR...

result:

ok ok (1000 test cases)

Test #21:

score: 0
Accepted
time: 17ms
memory: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BRRRRRBRBBRRB
RRRBBBRBRBRRRB
BBRRRRRRBRB
BRRRBBRRR
RRRRRRBBRBBB
RBRRRBRBBRBB
RRRBBBBRRRBBRR
BBBRRRRBR
BRBRRRBRRBRB
BRBRRBBBRRRRRRR
RRBBRBRRBRBR
RBRRRBRBRR
RBBRRR
RRBRRRBRB
RRBRRBRRB
IMPOSSIBLE
RBRRBRRBBRRBB
IMPOSSIBLE
RRBBRRR
IMPOSSIBLE
I...

result:

ok ok (1000 test cases)

Test #23:

score: 0
Accepted
time: 23ms
memory: 3964kb

input:

1000
6 7
4 3
2 4
2 6
1 2
6 4
5 1
3 5
6 13
2 6
4 6
2 5
4 2
4 1
3 6
4 5
2 1
1 3
6 1
5 6
1 5
3 2
6 14
2 6
6 4
2 1
3 4
1 5
5 3
3 6
2 4
1 6
4 5
5 2
6 5
1 4
3 2
6 14
5 2
6 5
3 2
1 4
5 1
1 6
6 3
5 4
2 4
3 5
6 2
3 1
3 4
6 4
6 5
6 5
4 3
3 2
2 6
1 6
6 15
3 4
2 3
4 2
3 1
6 3
4 5
1 5
6 1
1 4
6 5
5 3
4 6
6 2
5 2...

output:

RRRBRRB
BRRRBRBRRRBBR
BRRBBRRRRBRBRB
RBBRBBRRBRRRRB
IMPOSSIBLE
BRBRRRBBRBRBRRR
BRBRRBRR
BRRBBRBRRRBRRRR
BRRRRBBBRRBRRB
RBBRBRRRRR
BRRRBBRRRRB
RBRRBBRR
RBBRRBRRRBBRR
RRRRBRRBBB
BRRBRR
BRRBRR
RBBRBRRBRRR
RRBRBRR
RRBRRB
RRBBBBRRRRB
RBRRBRRBRRBRBB
RRRBRBRBR
BBRRRBBRRRR
BBRRR
RBBBRRRRBR
BBRRRRR
RBRRBBRRR...

result:

ok ok (1000 test cases)

Test #24:

score: 0
Accepted
time: 24ms
memory: 4236kb

input:

1000
7 15
5 1
5 4
7 4
2 5
3 4
3 7
5 6
3 6
2 4
6 4
1 6
2 6
7 5
7 1
3 1
7 15
4 1
6 4
3 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
IMPOSSIBLE
RRBBRBBB
BRBRBRRBRRRRBBRRRBB
RRRRBRRRBRBBBBRRBR
IMPOSSIBLE
RRBRRRBRBBR
RRRRRRBBBBB
RBRBBRRRBBRR
RRBRBBRBBRRBBRBRRRRBR
BBRRRRBBRRRRBB
R...

result:

ok ok (1000 test cases)

Test #26:

score: 0
Accepted
time: 27ms
memory: 4236kb

input:

1000
8 12
1 6
7 2
7 8
5 2
8 4
8 1
8 5
2 6
1 5
3 6
4 7
8 3
8 28
2 3
5 4
8 4
8 2
4 6
1 2
6 5
2 6
5 8
7 1
1 6
2 5
3 1
7 2
4 3
3 6
8 7
4 2
5 7
8 1
5 1
3 8
7 3
4 1
7 6
5 3
6 8
4 7
8 24
1 2
5 2
1 8
7 4
2 4
4 6
8 5
8 6
2 7
8 4
2 6
1 5
6 5
3 8
4 5
3 4
5 7
1 4
2 3
6 1
8 7
5 3
3 7
8 2
8 28
7 2
7 1
7 5
3 6
3 7...

output:

BBRBBRRRRRRB
RBRBBRRRRBRBRRRBBRRRBBRBBBRR
RBBBRRRBRRRRBRBRRRBBBBRB
RBRRBBBRBBBRRBRRRRBRBRBRRBRR
BBBBRRRB
RRRRBRBBBRRRRBRBRBBR
BRRRRBBRRBBRBRRBBBRBBBRR
BRBRRRRRBRB
RRBRRBBRRBR
RRBRRBBRRBRBBRRB
BBRBRRBRRRRBRRBBRBBBR
RRBBRRRBBBRRRBRBBBRRR
RBBRRBRBB
BRRRBRRRRB
BBRRBRRBRRRBRRBBRB
BRBBBRRBRRBRRRRRBBR
BBRR...

result:

ok ok (1000 test cases)

Test #27:

score: 0
Accepted
time: 29ms
memory: 4204kb

input:

1000
8 27
8 3
6 2
7 3
5 4
2 7
3 6
1 4
5 6
6 1
4 3
3 2
1 5
3 5
8 2
1 7
5 7
7 6
8 6
4 7
4 2
4 8
5 8
8 7
4 6
1 3
1 2
1 8
8 13
4 1
7 1
6 2
6 3
3 5
2 1
1 8
6 5
6 8
2 8
2 3
7 8
1 6
8 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POSSIBLE
RBBBRBRRRBBRBBBRRRRBRBR
RRBRBBRRRBRBRRRR
BRBRR...

result:

ok ok (1000 test cases)

Test #29:

score: 0
Accepted
time: 28ms
memory: 4264kb

input:

1000
9 17
8 3
9 7
3 5
2 8
9 5
2 5
1 9
8 7
1 7
4 7
3 2
2 1
3 9
8 5
6 8
8 4
9 4
9 36
4 3
9 1
8 2
3 2
7 4
2 7
3 6
9 5
7 5
6 7
6 8
4 1
5 3
2 1
1 5
2 6
4 6
2 5
8 3
7 3
1 8
4 9
1 6
3 1
7 1
9 8
8 7
8 5
4 8
6 9
5 6
4 2
5 4
3 9
2 9
7 9
9 27
6 1
6 3
1 5
7 1
7 2
3 7
2 5
5 9
4 2
7 5
7 6
3 1
7 9
4 8
1 4
4 3
8 1
...

output:

BRRRBRRRRBBBRBBRR
BBBRRRRRBBRRBRBBBRRBBRRRBBRRBBRRBRBR
BRBRBBRBRRBRRBRRBRRRBBBRBRR
IMPOSSIBLE
RRBBRRRRBBRBRRB
BRBBRBRRBBRRBBRRRRRBBBRRBRR
BBRBRBBRBRBRBRRRRR
RRBBRBRBRBBBRRRRBBRBRBRRRBRRRBBRBBB
RRRBBBBBBRR
RBRBRRBRRBBRBR
BRRBRBBRRBRBRRBBRBRRRRRRRBRBBBRB
RRRBBRBBRBBB
RBBRRRRRRBBRRBBBBRBBRBBR
BRRRRRBBR...

result:

ok ok (1000 test cases)

Test #30:

score: 0
Accepted
time: 35ms
memory: 4000kb

input:

1000
10 40
7 10
6 3
1 8
5 1
5 4
9 7
1 10
10 8
9 4
3 10
2 7
7 8
4 10
2 10
6 10
3 4
1 7
5 8
5 7
1 6
7 3
2 3
3 8
9 8
6 2
3 5
7 4
1 2
2 8
9 1
2 9
5 10
6 8
10 9
3 9
6 7
4 6
2 5
6 9
6 5
10 33
9 3
6 3
2 6
3 4
8 9
10 5
7 5
10 1
8 5
7 6
3 10
3 5
9 6
5 9
9 7
3 7
10 2
9 1
4 5
4 10
3 2
4 9
4 8
3 8
2 5
4 7
8 2
8...

output:

BBBRRRBRBBBRBRRRRBBRRRBRBRBRBBRRRRBBRRBB
RBBRBRBBRRBRRBBRRRBBBBRRRBBBBBRRR
RRBBBRBBBRRRRRBBRRBBRBRRRBRBRRBR
RRBBRBBRRRRRBBRBBRBRBRRBBBRBBBRRR
RBBBRRBRBRRBRBRBRRBRRRBBBRBRBR
RRBRBRBRRBRRBBBBRBRRRBRRBRRBBB
RBBBRRRBRRRRB
RBRBBRBBBBBRRRRBRBRRRBBBRRRBRBRBRRRBBRRBR
BRBRBRRRBRRBRBRRBBB
BRRRBBBRRBRRBBBBRRBB...

result:

ok ok (1000 test cases)

Test #31:

score: 0
Accepted
time: 27ms
memory: 4068kb

input:

1000
10 24
2 7
3 9
5 2
5 1
6 4
6 5
6 10
7 9
5 7
8 1
4 7
10 8
3 7
10 7
9 1
5 9
9 2
2 4
10 1
8 2
8 6
2 1
9 4
5 4
10 42
2 1
3 8
7 3
4 6
7 1
2 5
7 5
4 1
10 9
2 10
2 3
3 5
6 7
1 9
8 5
7 8
10 5
1 8
1 6
10 3
6 8
8 9
1 5
3 1
2 4
4 7
9 7
4 10
5 4
10 6
10 1
2 9
8 10
7 10
3 9
7 2
6 3
9 5
3 4
2 6
9 6
4 8
10 21
...

output:

RRRRRBBRRBBRBBBRBRRBRRBB
RBRRBBRBBRRBBRRRBBRRBRRRRBBRBBBBBRBRRRBBRR
RBBRRRRBRBBRRRBBBBRRB
RBRRBRBBBRBRRBRBBRBRRRBBBRRBRBRBRRBRBBBR
RRBRBRBRRBBRRBRBRRBBRBBBBRRRR
RRBRBRRBBBRRBRBBRBRRR
RRBRRBBBRBBBBRRRBRBBRRRRRRBBBBBRRRRRBBBBBBR
RBRRRBRBBRRRBBRBRR
RBBRBRRRRBBRBRR
BRRBRBBBBRRBBBRRRRRRRRBRBBRBRBBRB
RBBR...

result:

ok ok (1000 test cases)

Test #32:

score: 0
Accepted
time: 36ms
memory: 4044kb

input:

1000
11 50
5 1
1 10
5 7
11 1
7 8
5 2
5 11
10 9
2 4
10 7
3 1
3 11
3 6
2 10
9 4
9 5
10 3
8 4
11 4
7 11
10 8
5 10
9 7
6 5
4 7
9 3
9 2
10 11
9 6
7 1
2 8
2 11
11 8
3 5
1 9
6 1
4 5
4 3
4 1
10 4
9 8
6 7
8 3
6 2
2 3
2 1
3 7
6 8
6 10
2 7
11 32
3 2
5 8
5 3
3 8
3 11
1 3
11 8
5 7
7 9
10 1
10 11
7 10
9 2
6 9
10 ...

output:

BBRRBRBRBRRBRBBRRRRRBBBBBBRRBBRBBRRRRRBBRRRBRRBBRR
RRRBBRRBRBRBBBRRRBRRBBRBRBRBRRBB
RBRBBRRRBRBBBRBBRRBRRBRBRBBRRRRBBRRR
RBBRRBBRRBRRRBRBRBRBRRBBRRRBRBRBBRRRRBBRBBB
BRBRBRBBRRBBBBBRRRRBBRBRRRRBRBBRRRRRBBBBR
BRRBRRBBRBRBBBRBBRRRRBRBRBRRRBRBBBRRRR
RBBRBRRRBRRRRRBBRRBRRBRBRBBRBBBRBRRBRBBBRBBBRBBBR
IMPO...

result:

ok ok (1000 test cases)

Test #33:

score: 0
Accepted
time: 35ms
memory: 4072kb

input:

1000
11 29
3 5
10 9
11 5
8 9
5 1
4 11
4 10
7 11
3 2
11 6
4 7
6 3
8 2
1 10
7 9
6 1
9 3
11 8
7 2
4 2
2 10
1 8
4 9
4 3
6 5
1 7
1 4
10 8
1 2
11 39
7 1
7 11
8 4
5 9
10 9
3 10
7 10
3 11
9 1
5 1
5 2
1 3
8 7
6 11
5 11
6 3
11 1
9 8
4 2
11 8
11 9
4 7
2 7
10 5
2 3
5 7
4 5
6 5
3 7
10 4
6 1
8 10
5 8
3 4
7 9
1 8
...

output:

RRBBBRBRBBBRRRBBBRRRBBRBRBRRR
BRRRBRBBRBRRRRBRRBBBBRBRRRBBBBRRRRRBBRR
RRBBBRBRRBRRBRRRBRBBBBRRBBRRBRRBRRRBBBRBRBBBR
RBRRRRBRRBBBRBRBBRBRBBBRBRRRBRRRBBBRBR
RRRRBRBRRBRBRBBRR
RBRBRRRBRRBBBRRBBRBRBR
RBBBRRBBRRBBBRBRBRBRBRRRRRBBBBBRBRBRBRRRBRRBRRBRB
RBRBBBBRRBRRBRBRRRRRB
BBRRRBBRRBRRBBBRRBBRBRBRRRBBRBRR...

result:

ok ok (1000 test cases)

Test #34:

score: -100
Wrong Answer
time: 39ms
memory: 4048kb

input:

1000
12 25
6 9
3 1
6 10
11 6
12 1
7 8
11 12
6 5
4 1
5 4
7 5
6 7
8 1
6 2
12 4
10 11
9 12
2 9
8 4
7 3
6 1
6 8
7 2
11 3
5 12
12 25
8 5
1 8
2 12
5 1
7 5
8 4
1 11
6 7
7 4
4 1
12 10
8 11
12 6
8 2
6 10
10 9
6 2
7 10
4 3
9 6
10 2
5 2
11 12
1 7
9 5
12 24
6 8
7 8
12 10
4 10
12 5
8 12
3 1
1 11
12 3
4 5
1 5
11 ...

output:

BBBBBBBRRBRBRRRRRBRRRRBRB
RBBBBRRRRRRBRRBBBRBRRRBRB
RBRBBBRBRRBRRBBRRRBBBRRR
RBBBBRBRBRRBBRRRBBRRBRRRBRRBBRRRBRBBRBRRBBRRRBBRRBBBBBRBR
RBBBRBBRRBRRRBRRRBBRRRRBRBRRBBRBRBBRBBBRRRBRRBRBRB
RRBRBBRRRBRRBBBBBRRRBBRRRBRBBBBRBRRBR
RRBRBRRRBBBRBRRRRRRBBBBRRBBRRRRRBB
BRBBBRBRRRBBRBBBRRRBRRBRRBRRRBBRBR
BRBBRR...

result:

wrong answer jury has answer but participant doesn't (test case 190)