QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#705100#1874. Goldberg Machine 2carrotqqAC ✓630ms73956kbC++144.0kb2024-11-02 22:08:552024-11-02 22:09:01

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 21792kb

input:

3 3 9
>v>
vv>
v.>

v>>
v>>
v.>

2 3 1
2 2 1
2 1 1
1 3 3
1 2 2
2 3 3
2 3 1
1 1 2
1 2 1

output:

1
-1
-1
2
14
-1
-1
-1
-1
0

result:

ok 10 tokens

Test #2:

score: 0
Accepted
time: 98ms
memory: 22176kb

input:

1 1 100000
v

v

1 1 1
2 1 1
2 1 1
1 1 1
2 1 1
2 1 1
1 1 1
1 1 1
2 1 1
2 1 1
2 1 1
1 1 1
1 1 1
1 1 1
2 1 1
1 1 1
2 1 1
2 1 1
1 1 1
1 1 1
1 1 1
1 1 1
2 1 1
1 1 1
1 1 1
2 1 1
2 1 1
2 1 1
2 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
2 1 1
2 1 1
1 1 1
1 1 1
2 1 1
1 1 1
2 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
2...

output:

0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
...

result:

ok 100001 tokens

Test #3:

score: 0
Accepted
time: 101ms
memory: 21924kb

input:

2 2 100000
>v
v>

>>
>v

2 1 1
1 1 1
2 1 1
1 1 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
0
-1
-1
-1
2
-1
-1
-1
-1
-1
1
-1
1
-1
-1
-1
-1
-1
-1
1
-1
1
-1
-1
-1
2
-1
-1
-1
2
-1
-1
-1
1
-1
1
-1
-1
-1
-1
-1
-1
-1
1
-1
-1
-1
2
-1
1
-1
-1
-1
-1
-1
-1
-1
1
-1
2
-1
-1
-1
1
-1
-1
-1...

result:

ok 1001 tokens

Test #5:

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

input:

2 3 1000
vv>
v>v

>>v
v>v

1 2 1
1 2 2
1 2 3
1 1 2
2 1 2
1 2 2
1 1 2
2 1 2
2 2 2
1 1 2
2 1 2
1 1 1
1 1 2
2 1 2
1 2 2
1 1 2
2 1 2
2 2 2
1 1 2
2 1 2
2 1 1
1 1 2
2 1 2
1 2 2
1 1 2
2 1 2
2 2 2
1 1 2
2 1 2
1 2 1
1 1 2
2 1 2
1 2 2
1 1 2
2 1 2
2 2 2
1 1 2
2 1 2
1 1 1
1 1 2
2 1 2
1 2 2
1 1 2
2 1 2
2 2 2
1 1...

output:

7
-1
-1
-1
5
-1
-1
-1
-1
-1
3
-1
2
-1
-1
2
-1
-1
6
-1
-1
-1
-1
-1
-1
3
-1
-1
-1
-1
-1
-1
3
-1
-1
7
-1
-1
5
-1
-1
-1
-1
4
-1
-1
-1
-1
3
-1
-1
1
-1
-1
5
-1
-1
-1
-1
-1
-1
5
-1
-1
-1
-1
-1
-1
2
-1
-1
6
-1
-1
6
-1
5
-1
-1
-1
-1
-1
3
-1
-1
5
-1
-1
-1
-1
-1
3
-1
2
-1
-1
2
-1
-1
6
-1
-1
-1
-1
-1
-1
3
-1
-1...

result:

ok 1001 tokens

Test #6:

score: 0
Accepted
time: 112ms
memory: 21928kb

input:

1 10 100000
v>>>>>>v>>

>v>vvvvvvv

1 1 3
1 1 8
1 1 1
2 1 1
1 1 7
1 1 1
2 1 1
2 1 7
1 1 1
2 1 1
1 1 2
1 1 1
2 1 1
1 1 7
1 1 1
2 1 1
2 1 7
1 1 1
2 1 1
2 1 2
1 1 1
2 1 1
1 1 7
1 1 1
2 1 1
2 1 7
1 1 1
2 1 1
1 1 5
1 1 1
2 1 1
1 1 7
1 1 1
2 1 1
2 1 7
1 1 1
2 1 1
1 1 2
1 1 1
2 1 1
1 1 7
1 1 1
2 1 1
2 1 7
...

output:

135
139
11
10
9
73
74
75
139
138
137
139
140
141
77
76
75
11
12
13
15
14
13
77
78
79
143
142
141
157
158
159
95
94
93
29
30
31
29
28
27
91
92
93
157
156
155
153
154
155
91
90
89
25
26
27
43
42
41
105
106
107
171
170
169
171
172
173
109
108
107
43
44
45
47
46
45
109
110
111
175
174
173
429
430
431
36...

result:

ok 100001 tokens

Test #7:

score: 0
Accepted
time: 110ms
memory: 21852kb

input:

9 1 100000
>
>
v
>
v
>
v
>
v

>
v
>
v
v
>
>
>
v

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

output:

58
59
43
75
203
53
51
49
53
55
57
61
59
57
49
51
53
49
47
45
41
43
45
37
35
33
37
39
41
45
43
41
215
213
211
215
217
219
223
221
219
211
213
215
211
209
207
203
205
207
199
197
195
199
201
203
207
205
203
53
51
49
53
55
57
61
59
57
49
51
53
49
47
45
41
43
45
37
35
33
37
39
41
45
43
41
25
27
29
25
23...

result:

ok 100001 tokens

Test #8:

score: 0
Accepted
time: 112ms
memory: 22084kb

input:

3 3 100000
>>>
vvv
>>v

>>>
vv>
>vv

1 1 1
1 1 2
1 1 3
1 2 1
1 2 2
1 3 1
1 3 3
1 3 1
2 3 1
1 2 2
1 3 1
2 3 1
2 2 2
1 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
-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
...

result:

ok 100001 tokens

Test #10:

score: 0
Accepted
time: 212ms
memory: 22164kb

input:

1 100 100000
v>vv>>vvv>>>>v>>>vvv>>>>v>>>vv>>vv>v>v>vv>vv>vvv>>>>vv>v>vvv>v>vv>>>vv>>>v>>v>>v>>vv>v>>>vvvv>>v>vv>

vvvv>>v>v>v>>v>vv>v>vv>v>>>>>v>v>>v>>>>>>>>v>vv>v>vv>>>vvv>vv>>>>v>vvvvvvv>v>v>v>>>>>>vv>v>>>>v>>>>v

1 1 8
2 1 62
2 1 53
2 1 91
2 1 25
2 1 65
2 1 71
1 1 54
2 1 59
2 1 98
1 1 56
1 1 89
...

output:

130162746902623059640821711746
130162746902623059640821711874
130162746904928902650035405826
130162746904933406249662776322
131400686944218786524561900546
131400686944218786524578677762
131400686962665530598288229378
131400685782073909880876925954
131400685782082917080131666946
131400685782371147456...

result:

ok 100001 tokens

Test #11:

score: 0
Accepted
time: 221ms
memory: 22100kb

input:

100 1 100000
>
v
>
v
v
>
v
>
>
v
v
>
v
v
>
>
>
v
>
>
v
>
>
>
v
v
v
>
>
>
v
v
>
v
>
>
>
v
v
v
v
>
>
>
v
v
>
>
>
v
v
v
v
v
v
v
>
>
>
v
>
>
>
>
>
v
>
>
v
>
v
>
>
>
v
>
v
v
v
v
v
v
>
>
>
>
>
v
>
>
v
v
v
v
>
v
>
v
>
v

v
>
v
v
v
>
>
>
>
>
v
v
>
v
v
>
>
v
v
>
>
v
v
v
>
>
v
>
v
>
v
v
v
>
>
v
v
>
>
v
v
>
v
...

output:

373624807217797461802635479613
373624806922649556623282653757
374243776942292246760732215869
576494173228879804361795188163
576532858855107472495385785795
576532858855107507679757874627
576532858855107507679757874755
576532858855107507679757940291
576532858855107507679755843139
576532858855107507679...

result:

ok 100001 tokens

Test #12:

score: 0
Accepted
time: 565ms
memory: 73956kb

input:

100 100 100000
vvvvv>vv>vv>>>v>>vv>vv>v>>v>>>v>v>v>>vvvvvv>v>>v>>>>>vv>>>v>v>>vvv>>vvvvvvvvvv>v>v>v>>v>vvv>>>vv>>vv
>>>v>vvv>>>vvvvvv>v>>>vv>>vvvv>>>>>>vv>>vv>>>>>v>>vv>>>vvv>>vvvv>>>v>>vv>v>v>>v>v>>vv>>v>>v>>>vv>v>v
vvv>>>v>v>>vv>vv>>>v>>>vv>vvvv>v>>>v>v>v>>>>vvv>>vvv>vvvvv>>>v>>>v>v>>vvvv>>vvvv>>v...

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
-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
-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 100001 tokens

Test #13:

score: 0
Accepted
time: 533ms
memory: 64116kb

input:

100 100 100000
>>v>v>vvv>v>vv>>v>>v>>v>vvv>vv>v>>>>>>>vv>vv>>>>vvvv>>>v>>v>v>>>....................................
v>>>>v>.>vvvv>v>>>>vvvv>>vvv>>v>.vv>>>>.>>vvvvvv>v>v>v>vv>v>vv>v>...................................
>>vv>>v>vvvv>>>>>vv>>vvv>v>v.>>>vv>vvvv>>>.vvv>v.>>>vvvvv>vvvv>>v>>vvv>vvvv>v>vv>vv...

output:

253528151914256935978069277722645579058348007113389173875510
-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
-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...

result:

ok 100001 tokens

Test #14:

score: 0
Accepted
time: 630ms
memory: 73288kb

input:

100 100 100000
vvv>>v>>vvv>v>>vv>>>vv>>>>v>>vv>>>>vvvv>v>v>>v>vvvvv>vv>vvv>>v>vv>vvv>>>>>vvvv>vvvvv>v>v>>v>v>>>>>v>
>vv>v>vvv>v>>>vv>>v>>v>v>>vvvvvvvv>>>vv>>vv>vv>v>v>>>v>v>v>vv>>>>>v>>v>v>>v>v>v>>>>>v>>vv>>>v>vv>>>v
v>v>v>v>>>v>>v>>>>>>>v>vv>vv>>>>v>>v>>vvv>v>v>>>vv>vvv>vv>vv>v>vvvv>vv>>>>vv>>>vvvv...

output:

23386290453762822566412058133305892764924256716359048750097
-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
-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
...

result:

ok 100001 tokens

Test #15:

score: 0
Accepted
time: 508ms
memory: 58792kb

input:

100 100 100000
vv>v>...............................................................................................
>vvvvv>vvv>>v>vvv>vv>>v.............................................................................
>vvv>>vv>.v>vv.vvv>v>v>v>>>...........................................................

output:

42658660090357251640628465467726161658558031734734431452118
-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
-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
...

result:

ok 100001 tokens

Test #16:

score: 0
Accepted
time: 299ms
memory: 34948kb

input:

100 100 100000
>>>v................................................................................................
v.v.................................................................................................
v.>v..................................................................................

output:

43815677202469463796265627043100870828664328138117793224362
-1
43815677202469463796265627043100870828664328138117793224361
-1
43815677202469463796265627043100870828664328138117793224360
-1
-1
-1
43815677202469463796265627043100870828664328138117793224359
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 100001 tokens

Test #17:

score: 0
Accepted
time: 173ms
memory: 29248kb

input:

100 100 100000
vvvv................................................................................................
v...................................................................................................
v.....................................................................................

output:

222453068264192526417000218257812802177233353809948814995323
-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
-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...

result:

ok 100001 tokens

Test #18:

score: 0
Accepted
time: 439ms
memory: 47032kb

input:

100 100 100000
>v>>v...............................................................................................
>vvv>>..............................................................................................
>>vv.v>>>.............................................................................

output:

201750991551104042432020447813933605717073792565088416920
-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
-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...

result:

ok 100001 tokens

Test #19:

score: 0
Accepted
time: 430ms
memory: 49644kb

input:

100 100 100000
v>v>>vvv............................................................................................
>v.>.>>v>vvv>>>.....................................................................................
......>vv.>v>>v.......................................................................

output:

39016689483511987693168985971494459264198641421031014240019
-1
39016689483511987693168985971494459264198641421031014240019
-1
39016689483511987693168985971494459264198641421031014240019
-1
39016689483511987693168985971494459264198641421031014240019
-1
390166894835119876931689859714944592641986414210...

result:

ok 100001 tokens

Test #20:

score: 0
Accepted
time: 371ms
memory: 56476kb

input:

100 100 100000
>...................................................................................................
>v>>>v>.............................................................................................
v>vvvv>>..............................................................................

output:

124624611308017348521697627034445754534951315753056709418940
124624611308017348521697627034445754534951315753056709418939
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
124624611308017348521697627034445754534951315753056709418938
124624611308017348521697627034445754534951315753056709418939
-1
-1
-1
-1...

result:

ok 100001 tokens

Test #21:

score: 0
Accepted
time: 288ms
memory: 73200kb

input:

100 100 100000
vv>v>v>>v>>v>v>vvv>>>vv>vvvvvv>v>>>>v>>v............................................................
vvv>>>vv>vv>>>>>vvv>>vv>v>>>v>vv>>>>vvv>>vv>v>v>vvv>>vvv>v>v>>>v>v>v>v>>>>v>>vvv>>vvv>vv>>v>vv>vvvv>
>>>>>v>>>vvv>v>>vv>vv>>>>>vvvvv>vv>v>v>v>>>>>vvv>>vvvv.>>v>>vvv>>v>vvvvvvvvv>v>v>v>...

output:

107671931810604867317823529653294578411322501736483480318371
93195323721768917124921731889350746903952872486365624094301
107671931810604867317823529653294578411322501736483480318371
294062579254142701567666993431996072219228246709214728506973
107671931810604867317823529653294578411322501736483480318...

result:

ok 100001 tokens

Test #22:

score: 0
Accepted
time: 250ms
memory: 73140kb

input:

100 100 100000
>vvv>>vv>>>>>>vvv>v>>>>vv>vvvv>>>v>v>vv>>>vv>>v>>>>>>>>vvvvv>>vv>>v>>>v>vv>v>>v>vv>vvvvvv>>>>vvv>vvv
vvvv>vvv>v>>>>vv>vvv>>vv>>>v>>vvv>>>v>>v>>v>>>>v>>>>>vv>>vvv>vvvvv>v>>>>>vv>>>>v>>vvv>>>v>vvvv>v>vv>
v>>v>v>>>v>>>>>vvvvv>v>>vvv>>v>vv>v>vv>vv>v>>vvv>>>vvvvv>>>>>>vvv>v>>>vv>vvvv>>>vv>...

output:

17082601553275761539905298915831996601457557630861824921682
-1
17082601553275761539905298915831996601457557630861824921682
-1
17082601553275761539905298915831996601457557630861824921682
-1
17082601553275761539905298915831996601457557630861824921682
-1
170826015532757615399052989158319966014575576308...

result:

ok 100001 tokens

Test #23:

score: 0
Accepted
time: 497ms
memory: 57336kb

input:

100 100 100000
v>vv>>>vvvv>>>v>>vv>v>vvvvvvvv>vvvv>v>vv>v>>vv>v>v>>>vvv>vv>>>vvv>v>vvv>v>v>vv>>>vv>vvvvv>v>vv>vv>>v
>.>.>.>.>.v.v.>.v.v.>.v.v.v.>.v.>.v.>.v.v.>.v.>.>.v.>.>.>.>.>.>.>.>.>.v.v.v.>.v.v.>.v.v.v.v.>.v.v.v.
vvvv>vv>v>>vv>v>vvv>>>vvvv>>>v>v>v>vvvv>v>>v>vvv>>>v>>v>>>>v>>v>>>v>v>v>vvv>>>v>>v>...

output:

18784946845871147976358177942986863608005443350565495986568
-1
18784946845871147976358177942986863608005443350565495986567
-1
18784946845871147976358177942986863608005443350565495986567
-1
18784946845871147976358177942986863608005443350565495986567
-1
187849468458711479763581779429868636080054433505...

result:

ok 100001 tokens

Test #24:

score: 0
Accepted
time: 474ms
memory: 52428kb

input:

100 100 100000
>>>>>>>>>>>>>>>>>>>>>>>v>>>>>>>>>>>>>>>>>v>>>>>>>>v>v>>>>>>>>>>>v>>>>>>>>>>>>>>>>>>>>>>>>v>>>>>>>>>>
>>.>>.>>.>>.>>.>v.>>.>>.>>.>>.>>.>>.vv.>>.>>.>>.>>.>>.>>.>>.>>.>>.>>.>>.>>.>>.>>.>>.>>.>>.>>.>>.>>.>
>..>..>..>..>..>..>..>..>..>..>..>..>..>..>..>..>..>..>..v..>..>..v..>..>..>..>..>....

output:

53381669762158452489209327555144242907672197839891108814646
-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
-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
...

result:

ok 100001 tokens

Test #25:

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

input:

100 100 100000
>>>>>>>v>>>>vv>>>>>v>>>v>>>>v>v>>v>>>>>>>>>>>>>v>>>v>v>>>>>v>>>v>>>>>>>>>>vvv>v>>>>>>v>v>>vv>>v>v>v>
>>.>v.>v.>v.>>.>>.>>.>v.>v.>>.>>.v>.v>.>>.v>.>v.v>.v>.>>.>v.>v.>v.>>.>>.>>.>>.>v.v>.>>.>v.>>.v>.v>.>
v..>..v..>..v..>..>..>..v..v..>..>..>..>..>..>..v..v..>..v..>..>..>..>..>..>..>..v....

output:

57275352746220220487283409946985056949752315135185187188423
-1
57275352746220220487283409946985056949752315135185187188423
-1
57275352746220220487283409946985056949752315135185187188423
-1
57275352746220220487283409946985056949752315135185187188423
-1
572753527462202204872834099469850569497523151351...

result:

ok 100001 tokens

Test #26:

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

input:

100 100 100000
vv>vv>v>>>>>>>>>>>v>vv>v>>>>>v>vvv>>>>>>vv>>>>>vv>v>>v>>>>>v>>>v>>>vv>v>v>vvv>>>vv>>>>v>>v>>>v>>>vv>
>>.>>.vv.>>.>v.vv.v>.>>.v>.v>.v>.vv.>v.>>.vv.>v.vv.>>.vv.>>.vv.>>.>v.v>.>>.>v.v>.v>.>v.vv.>v.>v.v>.v
>..>..v..>..>..>..>..v..v..>..>..>..>..v..>..>..>..>..>..>..>..v..v..>..>..v..>..v....

output:

64907501743444547022137361805387261917105074916262651128947
-1
64907501743444547022137361805387261917105074916262651128947
-1
64907501743444547022137361805387261917105074916262651128947
-1
64907501743444547022137361805387261917105074916262651128947
-1
649075017434445470221373618053872619171050749162...

result:

ok 100001 tokens

Test #27:

score: 0
Accepted
time: 348ms
memory: 52352kb

input:

100 100 100000
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv>vvvvv>vvvvvvvvvvvvvvvvv>vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
vv.vv.vv.vv.vv.vv.vv.vv.vv.vv.vv.vv.vv.vv.vv.vv.vv.vv.vv.vv.vv.vv.vv.vv.vv.vv.vv.vv.>v.vv.vv.vv.vv.v
v..v..v..v..v..v..v..v..v..v..v..v..v..v..v..v..v..v..v..v..v..v..v..v..v..v..v..v....

output:

21976302509188623113582373479770928527855534478211028789917
-1
21976302509188623113582373479770928527855534478211028789917
-1
21976302509188623113582373479770928527855534478211028789917
-1
21976302509188623113582373479770928527855534478211028789917
-1
219763025091886231135823734797709285278555344782...

result:

ok 100001 tokens

Test #28:

score: 0
Accepted
time: 281ms
memory: 30756kb

input:

100 100 100000
>>..................................................................................................
>>..................................................................................................
>>v>>.................................................................................

output:

4899093492166070486573268177568463493559612269189682940140
-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
-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
-...

result:

ok 100001 tokens

Test #29:

score: 0
Accepted
time: 351ms
memory: 34024kb

input:

100 100 100000
vv>vvvv.............................................................................................
v>vvv.v.............................................................................................
vvv>>vvvv.............................................................................

output:

5852208803576017905737030078378565171209408740723222843758
-1
5852208803576017905737030078378565171209408740723222843758
-1
5852208803576017905737030078378565171209408740723222843758
-1
5852208803576017905737030078378565171209408740723222843758
-1
5852208803576017905737030078378565171209408740723222...

result:

ok 100001 tokens

Test #30:

score: 0
Accepted
time: 346ms
memory: 38424kb

input:

100 100 100000
>>>.................................................................................................
>>>>>v..............................................................................................
>>>>v>>>..............................................................................

output:

229725942343818046032259298037952089749446429318663445046838
-1
-1
229725942343818046032259298037952089749446429318663445046839
-1
-1
-1
-1
-1
-1
-1
-1
-1
229725942343818046032259298037952089749446429318663445046840
-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 100001 tokens