QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#733919#9564. Hey, Have You Seen My Kangaroo?ucup-team3549AC ✓618ms39344kbC++233.5kb2024-11-10 22:05:392024-11-10 22:05:39

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 9648kb

input:

3 3 6
ULDDRR
010
111
010

output:







-1
4
2
1
0
0
0
0
0

result:

ok 9 numbers

Test #2:

score: 0
Accepted
time: 2ms
memory: 9900kb

input:

3 3 6
ULDDRR
010
111
011

output:







7
4
2
1
1
0
0
0
0

result:

ok 9 numbers

Test #3:

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

input:

1 5 1
R
11111

output:


4
3
2
1
0

result:

ok 5 number(s): "4 3 2 1 0"

Test #4:

score: 0
Accepted
time: 358ms
memory: 29660kb

input:

1 200000 200
RDRLDRULURDLDRULLRULLRRULRULRDLLDLRUDDLRURLURLULDRUUURDLUDUDLLLLLURRDURLUDDRRLRRURUUDDLLDDUUUDUULRLRUDULRRUURUDDDDLULULLLLLLLLLLLUDURLURLRLLRRRURUURLUDULDUULRRLULLRUDRDRUUDDRUDRDLLDLURDDDURLUULDRRDLDD
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:









































































































































































































3999923
3999865
3999864
3999740
3999729
3999728
3999727
3999726
3999725
3999724
3999723
3999665
3999...

result:

ok 200000 numbers

Test #5:

score: 0
Accepted
time: 327ms
memory: 18720kb

input:

2 100000 200
UULDRDLURDLDDRDRDUULDLUUULLRURLUUDDDRURURLLRRUDLDDDUDDRRUUURDDULURURLRULLUDLULURUUDURLDRRRDULRDLRRLDUUUDDUUDUDRDRUDLDRRUDRDLDRDLDRRDLRRDRDLRRLUDUDRULLRRLDDLUDDULDRLLLDLURRDDULDDUDULLRRRUURLRRRLURDLRLU
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
384513
384490
384313
384290
384113
384090
383913
383890...

result:

ok 200000 numbers

Test #6:

score: 0
Accepted
time: 338ms
memory: 17436kb

input:

5 40000 200
URDDRRUDURLDLUUDUUDDLRRRURULURDRRURRURULUULRRLDLLDUURRDRUULRULULUDRURRRURDDLLDDRLLLUDUDLLDDULUUUULDLDUDLULLDRURRDRDULURLLLUDLRRRDRLUDDUURULURRRDLDRUDLURUUULDLURDDDRRLLLDLRRDLDLDRRURRRRDLRRLLULRRLDUULD
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:









































































































































































































1000036
999836
999636
999436
999236
999036
998836
998636
998436
998236
998036
997836
997636
997436
9...

result:

ok 200000 numbers

Test #7:

score: 0
Accepted
time: 317ms
memory: 16616kb

input:

10 20000 200
UULRURURUDRUULRRRDDDULUURRDUURDLDLLURRDUDDRDULRDURLDDLRRRRRRURLLUUURURDDUDDLLRDRLDDDDRULDRLLDUDLLLUDRURLDDLRRULDRRLLRRRDLRUDDDRRLDLRUDRUUDDDLUDULLDLUDUDUUUDLLRUURRLRLLDLLLLRLLRRDRRLLUDDURDRRDDULLDDULR
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:









































































































































































































571658
571458
571258
571058
570858
570658
570458
570258
570058
569858
569658
569458
569258
569058
56...

result:

ok 200000 numbers

Test #8:

score: 0
Accepted
time: 337ms
memory: 16776kb

input:

20 10000 200
UUDUUDRDLLLURLULDRULUDLRURRUUDLDLUURUDURDRUULULULUURRDDDLUDLLRDDLDULLDURLRRUULLRDULUUDDLRDLDRDLDULULRLLLLUDUUUDDLDLLRLUUDLURLULLURDDDLLLUDDDLRDULLUUDRLDLRDLRLURRUUDLRULURRLLLURRUDLDUDRLUDDRDUUULLDDUDL
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:









































































































































































































83411
83305
83211
83105
83011
82905
82811
82705
82611
82505
82411
82305
82211
82105
82011
81905
8181...

result:

ok 200000 numbers

Test #9:

score: 0
Accepted
time: 344ms
memory: 17328kb

input:

50 4000 200
LUDLUULUUUDUDDUDRULLDDRDRDLDUDRUUDUUUDULDUURDUUDLRUDDDURURRRUDDRUDDRURURURUDLLLDRURLLRRURRLULDDLLURULRDURDDLURURDDURDDRURRDDDULUURLUDRRUULRLURUDULLRURUUDLRDDLULUDRULDRRLRRLURDLUDDRDRLRRDDULRULDLURRRUL
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:









































































































































































































53472
53272
53072
52872
52672
52472
52272
52072
51872
51672
51472
51272
51072
50872
50672
50472
5027...

result:

ok 200000 numbers

Test #10:

score: 0
Accepted
time: 513ms
memory: 17832kb

input:

100 2000 200
UDULUDLDUUDDUDLURDRDLDDLLDRLLDUURUDLLUURLRLLRDLUUUURLLUDRRUDUDDLRLLLDDUUDDULRUUULLRRUUUUUDRLLUUUURDUDLUUDLUDDRRULRLRLUDLRLRRRLRULULLRLLURRUUUDRLRRRRLUURULURUUUUDURRDDDRLLLLULDUDRLDURUUDDRRRULULRLRDULD
10111111111111111111111111111111111111111111111111111111111111111110111111111100111111...

output:









































































































































































































-1
-1
47281
47081
46881
46681
46481
46281
46081
45881
45681
45481
45281
45081
44881
44681
44481
4428...

result:

ok 200000 numbers

Test #11:

score: 0
Accepted
time: 517ms
memory: 17496kb

input:

200 1000 200
RLRDLDRDUDLRDULDLLURDULDLLDUDLULLLUUUDLRRRUDLUUUDDRLULRRLDLDLLDRLLLURDLDRRRLULUDDLUDUULULUULDRRURDDLUUULURULRUUDRRLRDULDUDRLDLRUDRLULLLLRLLDRDLDLRDUUUUUULUDLDRUDDUUDRLDRUDUUDLULLDDURLRULLRULDRLLRDLURR
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:









































































































































































































-1
10432
10232
10062
10032
9994
9887
9862
9832
9794
9687
9662
9632
9594
9487
9462
9432
9394
9287
926...

result:

ok 200000 numbers

Test #12:

score: 0
Accepted
time: 521ms
memory: 17736kb

input:

400 500 200
RULLRRRDLUDDRLDDRDLRLDLDLUUDRUDDULRDDLDULULLRUDULRLRLRUDURDRDDDLDRUDRLRDRLRDLULLLLRURRLRRULULDLDRDDULDDUULURLRLLDUUUUDDUDURLULRLDRLDDRULUDDLLRRDDULLDLURDLDRLLULRLRUULRLLLRULRUDLRRRLURUULLLDDDUDRDLRURD
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:









































































































































































































9541
9370
9369
9341
9244
9243
9170
9169
9141
9103
9044
9043
9039
9039
9022
8987
8970
8969
8960
8941
...

result:

ok 200000 numbers

Test #13:

score: 0
Accepted
time: 531ms
memory: 16400kb

input:

447 447 200
LULRUURRDLDUDDRDRLDDUDLRLURUDLLDDLRLRDLURURRDRDDDRRDDLLDRDDDUDULLRLURLLURULLLLRUUULDRDRRDDULULRLURDDUDURDULUURRLDURURDDUDDDDURRLRLLDLULDRURDUUURLRULURUULURURUDDRDDDDLLRRLLLDRLRDDRRLDDRULLLLRURDRUULRUU
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 199809 numbers

Test #14:

score: 0
Accepted
time: 499ms
memory: 17840kb

input:

500 400 200
DUUDRULRRRULLDUDDULULLRRDUDRULDRUURUDLDLDDDDRDLDUDRLDLDDURUDDLDLLLRLURDRULDLRLDRRUDRRULURDLDDDLULRLLRRDLUDLLULUULLRLLUURLDDULLRRDDRULUDRRLRRDURLLLDRDRRRLUDUUDUDDLRUDUDLRLDRLURULUULDUDLLDURDLLDDLRLULLU
111111111111111111111111111111111111111111111111011111111111111111111111111111111111111...

output:









































































































































































































11256
11056
10856
10656
10456
10256
10056
9856
9656
9456
9256
9065
9056
8865
8856
8665
8656
8469
846...

result:

ok 200000 numbers

Test #15:

score: 0
Accepted
time: 483ms
memory: 17976kb

input:

1000 200 200
LRUURLUDLDRURRLRLDRDLURDRUDUULDRLULLLRURRURDLULDULDDUDUULRLRDRLRLUDURULRDLDDLUURULDURDLLRUUDURDLURDDDUDRURRDRUUUUDLRUULRDDRLULDURLRDURDLDRRULRURLRUDLRRUUDRRDDLLUULDDDRDLRURLDLRDDULDDDUUDDRURURDDLRRRDR
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 200000 numbers

Test #16:

score: 0
Accepted
time: 459ms
memory: 16936kb

input:

2000 100 200
LRLUUDDLLUURLDRUUDUDRRULRDRDURURLRLLLRDLULLDRRRULDUDRDDRRRDUUDDDRLLULDRULRDDLDUULRDUDLRUUUDRDLRLDDUDLLDLLUDDLDRLRLURURLRRRLUULLLDLRLULDRRRLURDRDLRUDDLLLLRUDRLRLLRUDRDLUDLDRDDDLDUDLRDUURDRDUDDDUUDURUUU
11111111111111111111111111111111111111111111111111111111111111111111101111111111111111...

output:









































































































































































































-1
-1
-1
-1
-1
41180
40980
40780
40580
40380
40180
39980
39780
39580
39380
39180
38980
38780
38580
3...

result:

ok 200000 numbers

Test #17:

score: 0
Accepted
time: 323ms
memory: 16916kb

input:

4000 50 200
DRUDDUDULRURRULUUDLLUUURUURLLDUDRRUULULDLRRLUDURLRUDDLRRDLUDURUULRDRURUDUDRDLDUDLDURULURRLRRRDRDRRRDRDUDLUDRDUDLRLDDULLLLLUDRDLLUDRRRLUURDUULLRRLLRLDDLDRDDDUDLRRRURDRLLUDUUURLLDDLLRRLLDRUDRUULUULRURDR
11111111111111111111111111111111111111111111111111
111111111111111111111111111111111111...

output:









































































































































































































-1
112736
112536
112336
112136
111936
111736
111536
111336
111136
110936
110736
110536
110336
110136...

result:

ok 200000 numbers

Test #18:

score: 0
Accepted
time: 334ms
memory: 18432kb

input:

10000 20 200
UDLLURURULUUUDDLDRDRLDLRUULDLUUULUULLRRDUUDDLRDRRLUDUDLRRLUURLURRLULRRURLRRLLDLULUDRRDUUUDURRURLDDRRDRRDLDURDRLLURDDDDDURULRULULLUURLUDUUUUDDLURULRUDLUDDRLLUDRLDRRULUDRDUDRUDDDLLRRURULULDLLUDLLRUDRDRL
11111111111111111111
11111111111111111111
11111111111111111111
11111111111111111111
11...

output:









































































































































































































182271
182071
181871
181671
181471
181271
181071
180871
180671
180471
180271
180071
179871
179671
17...

result:

ok 200000 numbers

Test #19:

score: 0
Accepted
time: 329ms
memory: 18540kb

input:

20000 10 200
RULRLRLLLRUUDLLDDUDUURUUUUDUUDDRDDUULRRLDRDDRRLUURRLUDUDURUDRUDLDLDDURLRDRRRRUDRDLRRRULLLDLRURRDUUURURUDUUUDLLLRDLDDDLRULUDDURRUUDDDLURLDURRRRDLLLDRUDDDULRRLRDURRDURDDUDDUDLDRLLLULLULRULULLRLUUDRLDLDL
1111111111
1111111111
1111111111
1111111111
1111111111
1111111111
1111111111
111111111...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 200000 numbers

Test #20:

score: 0
Accepted
time: 339ms
memory: 19416kb

input:

40000 5 200
LDULRUULURUDRDLRUDUDURUUUDDRLUDDRUDUUUUDURUDUURDRLURLDURDUDRUULURUURRRRURRRLRLUUUULLLLDLDLRUUDDLDRLDURRRRUULDDLRRLRUUUDDRDRDRLLLLRDURLLLLDRRUULLDRLRULRURUDDURLDDRRRULUDULDULRDLDLRLRUUUDRLRRUUDLRULURRD
11111
11111
11111
11111
11111
11111
11111
11111
11111
11111
11111
11111
11111
11111
111...

output:









































































































































































































444424
444224
444024
443824
443624
443424
443224
443024
442824
442624
442424
442224
442024
441824
44...

result:

ok 200000 numbers

Test #21:

score: 0
Accepted
time: 319ms
memory: 22992kb

input:

100000 2 200
RRULURDRDDUULLLURURULUDRRDLULURRULUURDURDRRLDDRLRDLRLURRDDDRRDRLDDLUDRLUDDLLUDRLDRURLLDDLRURRRLLLLUULRULUDRRLLLLRLLUUULURDDDRRDRDULLLUULLRDDRUDUURRRLURURDLULURLURLDLRULUDDDRULRUDRLUDLDLLLUURDDLRLLULUU
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
829117
828917
828717
828517
828317
828117
827917
827717
827517
827317
827117
82...

result:

ok 200000 numbers

Test #22:

score: 0
Accepted
time: 405ms
memory: 39344kb

input:

200000 1 200
RUDRUUULRUDURLULRLLLRLDLLUURRLURRDDRLRLLDDUULDRURDLRRRLLLRRURURLDRUURLLRRRRLULLURLDULDLUURLLRUDLRRRRURLDRLLDDUUURDRUUULRLDRDLULRRUDRRDDDRLRDLUDLDUUULDDRUUDLULRDULLURUULLRULLUDDRDDLLRRUUUDULDLDRDLLDDDU
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:









































































































































































































4444289
4444280
4444277
4444231
4444174
4444171
4444118
4444117
4444094
4444089
4444080
4444077
4444...

result:

ok 200000 numbers

Test #23:

score: 0
Accepted
time: 373ms
memory: 17788kb

input:

447 447 200
DRUDULRLDRLUUUDRRDULUDRUURRRLDRDUDULDRLRLUDLDRURDRDUULRRUDRRLDULLRRLDDRRDRLRDRLRLDDRRULDLRDRUDRUDDRRLRRULDDDLRLRURLLULLDLDDRDDULRULURDULDULULRURDLLLRUDUUUURUDRDRLRLDRURRLLLURDUDDDDULLRDRDUDLDULLRULLLD
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:









































































































































































































12700
12500
12485
12478
12474
12316
12300
12285
12278
12277
12274
12144
12116
12100
12085
12078
1207...

result:

ok 199809 numbers

Test #24:

score: 0
Accepted
time: 618ms
memory: 17896kb

input:

447 447 200
RRUULDLLULUUDLDUUDDRLDUDLLDLUURDLDURLUDUDLRRDDDDUUULRDDRDURDDDLDRDDLRDDLULUDLURDDRUUDUUDUDLRRDRUDDUUDLRRUDLRDDLUUUDDURDLDDLULUURUURDDLLUDRDRDLLLRDRLUDLLRDUDRRRDURUDLLLUUUDULLRRUDRLLLDDLURUUDRLDDRUUURL
110111111111111111111111111111111111011111111111111111111111111111101111111101111111111...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 199809 numbers

Test #25:

score: 0
Accepted
time: 547ms
memory: 17972kb

input:

447 447 200
LULULUDRURRURLDRLUUDDLDUDRLLUDRLLLLDDUULLLLRLUDLRRLDRRRLURRULULURRRUULUUDRLUDDLRRDDRLLURLDDULLDURDULRRURULLRUURLUUUULULLDLRLDLULULDDRDUDRULUUDUUDRRRDRURUUDLDDRRLDLRLLULLRLURDDULRLUDLRLUDUDUDLLRRUULDDU
111101111111111101111111111110011111101101111111111111111111111111111111111001011101111...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 199809 numbers

Test #26:

score: 0
Accepted
time: 333ms
memory: 14516kb

input:

447 447 200
UDUDDURLLULURDRLLDLLRDDRDRUDRRRURLRDRDDURURDUUDRUUDURDRLULLRLDDLRURUDDRDULDUDDRLLDDRRULURRUUDDURRURDRRLUDLRLLDLUUDDLUDUULLLLUULDURRDDRDDLULLULDRLRLLUURLDUDRUDDLUUULUDUUUDUUDLUDDRLDDDRRDUURUUDDDRDLRLRL
001100011110110011011100101110111101101001000011011010011001100100000111110101010100100...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 199809 numbers

Test #27:

score: 0
Accepted
time: 71ms
memory: 12416kb

input:

447 447 200
DRLLUUDDULDRRDDDLLRRLUDLUURULDLRUDULDLLLRLDLLUDUDDULRUULRDDLDLUDRDRUDRRLLDDUDLDLULLUULRDRDRUUURDRRRDRRUULLDUUDDDUDRUDLRLRRLRUDDURULUUULULDDRRRLRURDLRDLDRUUDRUUDRRLDLUULLRLURURRURLLDDLRRLRURLRURULUULLR
000010000000000000101000000000100000000000000000000000000000001000000000000000000000000...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 199809 numbers

Test #28:

score: 0
Accepted
time: 596ms
memory: 16568kb

input:

100 2000 200
DURRLLDURUUDULRRUDRRUDLURRDUURLUURLUDLRURLRLRRRURDDRULRRULLUUDUDRDLUDDRRDRRDULUDUDULDRDLRUUULLRLULURRRRDDRUULDLLDUDDRLDURLULURUDRLRDLULRDLLLDRLDULLRRDLDURDUURLDLLRLLDDURUDRDDLUURDURRULRRRDDLLRRDURRDDU
11110111111111111011111111111111111011111111111111110111111111111111111111111011111111...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
32875
32675
32475
32275
32075
31875
31675
31475
31275
31075
3...

result:

ok 200000 numbers

Test #29:

score: 0
Accepted
time: 588ms
memory: 16428kb

input:

200 1000 200
UDDLRLLURDDRDLRURLUURDRRRUULUULLRDDLRRDUUDDULDDUULULLLRDRUUDRRULRDLLUUDURDLDUURLRDDUDRURDRLRUDRLURUULDRLURUURLRULUUULLLRUDDDLRULLLRRDULUDDURURUURDUUULDRURDDDULULRRULRLLULULLURDDLDRRULLLULDLUDLLRDDUDRL
11111111111111111111111111011111111111111111110111111111111111110111111111111111111111...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 200000 numbers

Test #30:

score: 0
Accepted
time: 579ms
memory: 16348kb

input:

400 500 200
URDRUUDRDUUDRRRUUDLDDLRRRLRULLRDDDULRURUURLLRDLULURRURRRLLRRLDUDLDRRRLLUUUDULLDRRDDRULULDUUDDRLRUURRRLDDRRUDRDDDDDLLURDLDUDDLRURLDRUUDUDRURURLDURRULDRLDDRLRLDLLUURUULRRRULLUDDLDRRDLDRRDRRURLURLDULDDLU
111111101111111111111111111111110111111101111011111111111111111111111111111111111111111...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 200000 numbers

Test #31:

score: 0
Accepted
time: 579ms
memory: 16524kb

input:

500 400 200
LRLLDDDLLRRLLRDURRLLDLUDLLRDRULRURULUDURRUDDRLRDRLURRDURLLLDLRUDRDLUURUDDUUDUUDUURRLDRURLDULDRLLLDDUUUULRDLUDURLLRDRRLUDLLRLURUULUURDRULLDDDLRDLRUURDUUDRDLDRURDDURUDUDRUUUDURUUDURDUUDURLDDRUDDDRLRLRDR
111111111111101101111111011111111111111111111111111111111111111111111111111111111111111...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 200000 numbers

Test #32:

score: 0
Accepted
time: 587ms
memory: 17168kb

input:

1000 200 200
RLRDURLUDDLRRURLUDRLUUURULRLLULRRRRUDLRRDLUULDRDURLDLURLUDULLRDLRLDLRUDLLRRULLUUDDRRDUUULUDLRLDUDLUURDUUURRUULRLRLUUDLLLULUDLRLDUUUURDUDRRDLRDLRRLRULDDRULURDUULULLUDDLLUDRURURRUDRUDLDRLRLDLUULLRUUUUDD
11111111110111111101111111110111111111111111011111111111111110101111111110111111011111...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
11932
11732
11725
11596
11532
11525
11520
11396
11393
1133...

result:

ok 200000 numbers

Test #33:

score: 0
Accepted
time: 552ms
memory: 18324kb

input:

2000 100 200
RLDDDLUDDURRDLURDUULDRDUURDULDDRLLRUDDULDDRURDUULLDDDUULDDRUUDRUUDLLLULRRDRULRUDURRRRDULRRLUUDRULRRUURURDUDULULDLLLUDDLLLURRDRRRDDDDRUULDLULUULURLLDDUUDRUDDRDDLLDUDRDDDLUUURRLLUUUDLLURURURRLUUUDUUDDUL
01111111111101111111110111111111111111011111111111111111111111111111111111111111101111...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 200000 numbers

Test #34:

score: 0
Accepted
time: 563ms
memory: 16588kb

input:

100 2000 200
UDDRLDUDRDRLLLRDLRLDLDULLULUUULDUUULULLDDDLLULRDLURLUUULRDRRLURURLULLLDULRUULURUDRDLRUDUDURUUUDDRLUDDRUDUUUUDURUDUURDRLURLDURDUDRUULURUURRRRURRRLRLUUUULLLLDLDLRUUDDLDRLDURRRRUULDDLRRLRUUUDDRDRDRLLLLRD
11111111111111111111111111111011011111111011111110111111111111100111111110111111110111...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 200000 numbers

Test #35:

score: 0
Accepted
time: 564ms
memory: 17032kb

input:

200 1000 200
ULRLUUDDRLUURDRRDULLDDULLLDLRULRRRRULRULLDRDRUUDLDLLLRUULRDUDLRDRLRUDDUDULUULDLUURLRRUUURRDURLDLRUURUDULRDUDLDULLURRURURULDLDDRDRRUURRULRLDURRLLDRUDDUURLLLRRLDLRDDRLRUULLDLRLDDRUUDRUULRDRDLDULULLULLDU
11111111111111111111111111111111111111111111111111111111101111101111111111111110111111...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 200000 numbers

Test #36:

score: 0
Accepted
time: 543ms
memory: 17044kb

input:

400 500 200
RURRDRUULDRLDRRLLRURRLUDLRURLLRLDRLURURLDLDLUULDURDLDUULDDULRDUULRDLURDDUURRDRULDRLRLUURUURLUUURRURDDRDDRUUDLULRDDDULULLLUDLDDRRLRUDDULLUDUDLDRLUUURLLULRLRDURLUDLDRDLDDDRRLDURLLDLRDDDRRDUURRRRRRDDRLUD
111111100111111111111111111111111111111111101110111101111011111110101111111111111110101...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 200000 numbers

Test #37:

score: 0
Accepted
time: 596ms
memory: 16764kb

input:

500 400 200
DUULDRURLULRULDLULUURLLUDRUDRULUDULUUDUUURUDUDRLLDLLRRDDDDLRRLRURLULDURRLULULLULLDUDLUUUUDRRRDUDDDDLLUDLRRLUURUULRULDRLDLLRURDRURDDULDLRRLLLDLRUULUURRRLUURLDLLURRULLURDLRDDDLLURLRRUURDDULLRDDDRLRLUURD
011110111111111111101111101111111111111111110111111011111111111111111111111111111010011...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 200000 numbers

Test #38:

score: 0
Accepted
time: 540ms
memory: 17992kb

input:

1000 200 200
RRDDDLLDLLDUDURDLRDURUDDRUULLDLURUDDULLDLLRDRURLLLUULLUURDUDURUURURUUUURRUDRDRRLRRULRDULUUURLRRRULULDDDURDRURDRURLRRRRRDDLDRUDDDDLDDDURRURLRLUUDURRDRRRRLLLDRLUULURRLDUULUDUDLDRLRRLULRRRURDLDRLRDDRRDLR
01111111111111111111101111111011111111111111111111111101111111111011111111111110111111...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 200000 numbers

Test #39:

score: 0
Accepted
time: 535ms
memory: 17276kb

input:

2000 100 200
LRRDLURLLDLUULULRRRURURRRULRLLDURRDLUDUURUDUUURDUURULLDUUDURLDRLULUDRDUUULDRDURRDUURURUUDRDDRLDRDRRLLRDRDDDUDLRRRRDRRLRDRURDUDRRLLLLDRLULRDRRRRLURLLLRRDURLRDRDUUUDRUDURURLUULULLLURLLLULUURRRUULUDRULDU
11111111111111101111110100111111011111111111110110111111111111111111110011111110111111...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
26086
25886
25686
2...

result:

ok 200000 numbers

Test #40:

score: 0
Accepted
time: 193ms
memory: 19340kb

input:

66663 3 200
RUDLLUDRLUDRLDURRDULRDULLDDRUDLLDURLDURLUDRLUDRLDURRUDLRDULRUDLRDULLUDRRUDLRDULRDULRDULLUDRLDURLDURRUDLLUDRRUDLLDURRDULLUDRLUDRRDULRDULUDRUDLLUDRRDULLUDRRDULRDULLDURLUDRRUDLLDURRUULDURRDULLUDRLUDRRUDL
011
010
011
010
011
010
011
010
011
010
011
010
011
010
011
010
011
010
011
010
011
010...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 199989 numbers

Test #41:

score: 0
Accepted
time: 255ms
memory: 26380kb

input:

66666 3 200
RURRLUUUULDLDRRRURURRLRULDLLRRRULURURULDUUDDDUURDRDLDRUUDLLUUULDDULULLLLLDLURUDURLDDDULRLDURRLURULRLDDURUDUDRDDLDDLLULDDLLLLDUDRDRLLRUDUULDLLRLLDDLRURRLURUDLUDUDDDUURDLRLDURRDRLRRDRDRLDDLLUDRRRRURRLUU
101
101
101
101
101
101
101
101
101
101
101
101
101
101
101
101
101
101
101
101
101
101...

output:









































































































































































































-1
-1
-1
-1
13320869
13320681
13320669
13320481
13320469
13320281
13320269
13320081
13320069
1331988...

result:

ok 199998 numbers

Test #42:

score: 0
Accepted
time: 398ms
memory: 27712kb

input:

200000 1 200
LRLLRRLLRLRRLRLLRRLRLLRRLLLLRLLRRRRRLRRLLRRLLLLLRLLRRRRRLRLLRLRLLRRRRLRLLRRLRLRLRRRRLLLLRRRRLRRLLRLRLLLLRLLRLLRLRRRLRLLLLRLLLLLLLLLLLRRRLRLRRRLRRRRLLRLLRLRLRRRLLRLRLLRLLRRLLLRLLLRRRRLRRRRLLLRRRRRRRRLR
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 200000 numbers

Test #43:

score: 0
Accepted
time: 352ms
memory: 27764kb

input:

200000 1 200
DUDDUUUDDUUDUUUUDDDDUDDUDUDUUDDDUUDUUDUUUUUDDUDUDUUDDDUUUUDUUDDDDUDDUDDUDDDDUUUUUDUUUUUDUDUDDDDUUDUDDDDUDDUUUDUUDDDUDUUDUDUDDDUDDDDDUDUDUUDUUUDUUDDDUUDUDUDUUDDUUDDUUDDUUUUDUUUDDDDDDUUDUUDDUUDUUDUDDUDD
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 200000 numbers

Test #44:

score: 0
Accepted
time: 220ms
memory: 15372kb

input:

4 49999 200
RRRUUUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDULLDD
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 199996 numbers

Test #45:

score: 0
Accepted
time: 203ms
memory: 19432kb

input:

4 49999 200
RRRUUUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDULLDD
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:









































































































































































































-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 199996 numbers

Extra Test:

score: 0
Extra Test Passed