QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#634485#7057. Digital PathZhaoZiLongAC ✓113ms100152kbC++112.1kb2024-10-12 17:25:382024-10-12 17:25:38

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 18556kb

input:

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

output:

4

result:

ok single line: '4'

Test #2:

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

input:

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

output:

16

result:

ok single line: '16'

Test #3:

score: 0
Accepted
time: 82ms
memory: 91920kb

input:

1000 1000
1000000 99999 99998 99997 99996 99995 99994 99993 99992 99991 99990 99989 99988 99987 99986 99985 99984 99983 99982 99981 99980 99979 99978 99977 99976 99975 99974 99973 99972 99971 99970 99969 99968 99967 99966 99965 99964 99963 99962 99961 99960 99959 99958 99957 99956 99955 99954 99953 ...

output:

990039586

result:

ok single line: '990039586'

Test #4:

score: 0
Accepted
time: 9ms
memory: 26700kb

input:

146 237
1 1 1 1 1 1 2 3 4 5 1 1 4 1 1 2 3 1 1 1 2 1 1 1 4 1 1 2 3 4 5 6 7 1 1 1 1 2 3 1 2 3 1 2 3 6 7 1 1 1 1 2 1 1 1 2 1 1 1 2 1 1 2 3 1 2 3 1 1 2 1 1 1 2 1 2 3 4 1 1 1 2 1 2 1 1 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 2 3 4 5 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 1 1 1 1 2 1 1 1 1 2 3 1 1 1 1 ...

output:

152287

result:

ok single line: '152287'

Test #5:

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

input:

211 597
1 1 2 1 2 3 4 1 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 2 1 1 1 1 2 1 2 1 2 3 1 1 1 1 1 2 3 4 1 4 5 6 1 2 1 2 1 1 1 1 2 3 6 1 1 2 1 2 1 1 1 1 1 1 2 1 2 1 1 2 1 2 1 1 1 2 3 4 1 1 2 1 1 2 1 1 1 1 1 1 2 1 4 5 1 2 3 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 3 4 1 1 1 2 3 1 2 1 2 3 1 1 1 1 1 ...

output:

399561

result:

ok single line: '399561'

Test #6:

score: 0
Accepted
time: 16ms
memory: 29060kb

input:

231 551
1 1 1 1 1 1 1 1 1 2 1 2 1 1 1 1 1 1 1 2 3 1 1 1 1 2 1 1 9 8 1 2 1 1 1 1 1 1 2 3 1 1 2 1 1 1 1 2 1 1 1 2 3 1 1 1 2 1 1 1 1 1 2 1 1 2 1 2 1 1 1 1 1 1 1 1 1 6 1 2 3 4 1 1 2 1 1 2 1 1 1 1 2 3 1 1 2 1 6 1 2 5 6 1 1 2 3 1 2 3 4 1 1 2 1 1 1 2 1 1 2 1 2 1 2 3 1 1 2 1 6 7 1 2 1 1 2 1 1 1 1 2 1 1 2 1 ...

output:

1188595

result:

ok single line: '1188595'

Test #7:

score: 0
Accepted
time: 22ms
memory: 29976kb

input:

342 549
1 1 1 1 1 1 1 1 1 2 3 1 1 2 1 1 1 1 1 2 5 1 1 2 3 4 1 2 1 1 2 1 1 1 2 1 1 2 1 1 2 3 1 2 3 1 2 3 1 1 1 1 1 2 3 6 1 1 1 1 4 1 4 5 6 7 8 1 1 2 3 1 1 1 2 3 4 5 6 7 1 1 1 1 1 1 1 2 3 1 1 1 1 1 1 1 2 3 4 1 1 1 2 3 4 5 6 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 2 1 1 1 2 3 4 1 1 1 1 1 1 1 1 5 6 1 1 1 1 1 1 1 ...

output:

628608

result:

ok single line: '628608'

Test #8:

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

input:

352 26
1 2 3 1 1 2 3 1 1 2 1 1 1 1 1 1 2 3 1 4 1 1 1 1 1 1
1 1 4 5 1 1 4 1 1 3 4 5 6 3 2 4 3 1 2 3 4 1 1 1 1 2
1 1 1 6 2 6 5 1 13 1 9 8 7 4 3 1 1 1 2 6 5 1 2 1 1 3
2 1 1 2 3 7 6 1 12 11 10 1 1 5 6 2 1 1 1 7 1 1 3 1 2 4
1 1 1 1 4 8 1 2 13 1 11 1 9 8 7 1 1 12 11 8 1 2 4 5 1 2
3 2 3 4 1 1 1 1 1 2 3 11 ...

output:

10827

result:

ok single line: '10827'

Test #9:

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

input:

365 252
1 1 1 1 1 1 1 2 1 1 2 1 2 1 1 1 1 1 1 2 3 6 1 1 4 5 1 2 3 1 1 1 1 1 2 1 2 1 1 1 1 2 3 1 1 1 1 1 1 1 1 1 2 3 1 2 3 4 5 1 1 1 2 1 1 1 1 1 1 2 3 1 2 1 1 1 1 1 1 2 1 1 1 2 3 1 2 3 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 2 1 2 1 2 3 4 5 6 1 2 3 1 1 1 1 1 1 2 3 4 5 1 1 1 2 1 1 1 2 1 2 3 4 5 ...

output:

166369

result:

ok single line: '166369'

Test #10:

score: 0
Accepted
time: 20ms
memory: 36012kb

input:

185 914
1 1 1 1 1 1 1 1 1 2 3 4 1 1 9 1 1 1 1 1 1 1 2 1 1 2 3 4 5 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 2 3 1 1 2 1 2 1 1 1 1 2 1 2 3 1 1 1 1 2 3 4 1 1 1 2 3 4 1 2 1 1 2 1 2 3 4 1 2 1 2 3 1 1 1 1 2 1 1 1 1 2 1 2 1 1 2 3 4 1 2 1 1 1 1 1 1 2 1 1 1 2 1 2 7 1 1 1 1 2 1 1 1 1 1 1 1 1 2 1 1 2 3 1 1 1 2 1 1 ...

output:

486846

result:

ok single line: '486846'

Test #11:

score: 0
Accepted
time: 19ms
memory: 29956kb

input:

381 458
1 1 2 3 1 1 2 3 4 5 1 2 3 4 5 1 1 1 1 1 1 1 1 2 1 1 1 1 2 1 1 1 2 1 2 1 2 3 4 1 1 1 1 2 3 1 2 1 1 2 3 4 1 2 3 4 1 2 1 1 2 1 1 1 2 3 4 1 2 1 1 1 1 1 1 2 3 4 7 1 1 1 4 5 1 1 1 1 1 2 3 4 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 1 1 2 5 6 7 1 2 1 1 1 2 3 1 2 1 1 1 1 1 1 2 1 1 2 3 1 2 3 4 1 1 1 1 1 ...

output:

877099

result:

ok single line: '877099'

Test #12:

score: 0
Accepted
time: 22ms
memory: 35468kb

input:

401 412
1 1 1 2 1 2 1 1 1 1 1 1 1 1 1 1 1 2 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 1 1 1 1 2 1 2 1 1 1 2 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 5 1 1 1 1 1 2 3 1 1 1 2 1 2 1 1 1 1 1 5 6 1 1 1 1 2 1 1 2 5 6 7 8 1 1 1 1 1 2 3 1 1 2 3 1 1 1 1 2 1 1 1 1 4 5 1 1 1 2 3 4 1 2 1 1 2 1 2 1 2 1 1 1 1 1 1 1 1 1 1 2 3 4 1 ...

output:

710978

result:

ok single line: '710978'

Test #13:

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

input:

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

output:

3603480

result:

ok single line: '3603480'

Test #14:

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

input:

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

output:

229311

result:

ok single line: '229311'

Test #15:

score: 0
Accepted
time: 30ms
memory: 37136kb

input:

437 573
1 1 2 1 1 2 3 1 1 2 3 4 1 1 7 8 9 1 1 1 1 2 1 1 1 2 1 1 2 3 1 1 1 1 1 1 1 1 2 1 1 1 1 2 3 4 1 1 1 4 1 2 3 4 1 2 3 1 1 2 1 2 5 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 2 1 1 1 1 1 2 3 1 2 1 1 1 1 1 1 1 2 3 4 5 6 13 12 1 1 1 1 1 1 2 3 4 1 2 1 2 1 2 1 2 1 4 1 2 1 2 3 4 1 1 1 2 1 1 2 1 1 1 1 2 1 1 1 2 5 1 ...

output:

1124492

result:

ok single line: '1124492'

Test #16:

score: 0
Accepted
time: 4ms
memory: 24584kb

input:

446 50
1 2 3 4 1 1 2 1 6 7 8 1 1 1 2 1 1 2 1 2 1 4 1 1 1 1 1 1 1 2 1 2 5 1 1 2 3 4 1 1 2 1 1 2 1 1 1 1 1 1
1 2 3 3 2 7 3 4 5 1 1 1 1 1 2 1 1 3 4 3 2 3 4 2 3 2 2 2 1 2 1 3 4 1 2 3 4 5 6 1 1 2 3 1 2 2 1 2 2 5
1 1 1 4 5 6 4 5 6 7 2 2 3 1 3 2 2 4 5 1 1 1 5 6 7 8 11 12 13 3 4 5 1 2 3 4 9 10 11 2 1 3 4 5 ...

output:

31752

result:

ok single line: '31752'

Test #17:

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

input:

456 527
1 1 1 2 1 2 3 1 2 1 2 1 1 1 2 5 6 7 1 1 1 4 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 13 1 2 3 4 7 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 2 3 1 1 1 1 1 2 3 1 1 1 1 1 1 1 2 1 1 1 2 3 1 2 3 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 2 1 1 2 1 2 3 1 2 1 2 1 2 1 2 1 1 1 2 3 4 1 6 1 1 1 1 1 1 1 1 1 2 3 4 1 1 1 1 1 1...

output:

743785

result:

ok single line: '743785'

Test #18:

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

input:

466 4
1 2 3 4
1 1 1 5
2 1 1 6
1 1 1 1
2 3 1 1
1 4 1 2
1 2 1 1
4 3 1 2
5 4 1 1
1 5 2 1
1 2 3 1
1 1 4 5
2 1 2 1
1 4 3 2
10 5 6 3
9 8 7 8
1 1 1 9
1 2 11 10
1 3 4 5
2 1 1 2
3 2 1 3
1 2 2 1
1 1 3 1
1 2 4 5
2 10 7 6
1 9 8 1
2 1 1 2
3 4 1 1
4 5 6 1
9 8 7 8
10 1 8 9
11 2 1 10
1 2 1 1
1 3 1 1
1 4 2 1
1 5 6 1...

output:

719

result:

ok single line: '719'

Test #19:

score: 0
Accepted
time: 60ms
memory: 55492kb

input:

482 978
1 2 3 1 1 1 1 1 1 1 1 1 1 1 1 2 1 4 5 1 2 3 1 1 1 1 1 1 1 1 1 1 4 1 1 1 1 1 2 1 2 1 1 1 1 1 1 1 1 1 2 3 4 5 1 1 1 1 2 3 6 7 1 1 1 1 1 1 1 1 2 3 4 5 1 1 1 1 1 2 3 6 7 8 1 1 1 1 1 1 1 2 3 1 1 1 1 2 3 1 1 2 3 1 1 2 1 1 1 1 1 2 3 1 1 4 5 1 2 1 1 1 2 3 4 1 2 3 1 1 1 1 1 1 1 2 1 1 2 1 1 2 1 2 1 1 ...

output:

1819069

result:

ok single line: '1819069'

Test #20:

score: 0
Accepted
time: 12ms
memory: 29152kb

input:

499 185
1 1 1 1 1 2 3 4 5 8 1 1 1 2 1 2 1 2 3 4 5 6 1 1 1 1 2 3 4 1 1 1 1 1 1 1 1 2 3 1 1 2 1 1 2 3 1 1 2 3 1 1 1 1 1 1 1 1 4 1 2 3 1 1 2 3 4 5 6 7 1 1 1 1 1 1 1 2 1 1 2 1 2 1 1 1 1 1 1 2 1 1 2 3 1 1 2 1 1 1 1 2 6 7 10 11 12 13 14 15 1 1 1 1 1 1 1 2 3 4 5 6 1 1 1 1 1 1 1 1 1 1 2 1 1 1 2 1 2 1 1 2 3 ...

output:

521236

result:

ok single line: '521236'

Test #21:

score: 0
Accepted
time: 14ms
memory: 28856kb

input:

518 139
1 1 1 1 1 1 1 1 1 1 2 3 4 1 1 1 1 1 1 1 1 2 3 4 1 1 1 1 4 1 4 5 1 1 2 1 1 1 1 2 1 1 1 2 1 1 2 5 1 2 1 1 2 1 2 3 1 1 1 1 2 1 1 2 1 1 2 3 1 1 1 4 5 6 1 2 3 1 1 2 1 1 1 1 1 1 1 1 2 1 1 1 1 2 1 1 1 1 1 1 1 1 1 2 3 7 1 1 1 1 1 1 1 1 1 1 2 3 4 1 1 9 1 1 1 1 1 1 1 2 1 1 2 3 4 5 1 1 1
1 1 1 1 2 1 1 ...

output:

252133

result:

ok single line: '252133'

Test #22:

score: 0
Accepted
time: 52ms
memory: 51816kb

input:

541 842
1 2 1 2 1 4 1 1 1 2 3 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 1 1 2 3 1 2 3 1 1 1 2 3 1 1 2 1 2 5 6 7 10 11 12 13 1 1 1 1 2 1 2 3 6 1 2 3 1 2 1 2 1 1 2 1 1 2 1 1 1 2 1 2 1 1 1 1 2 1 2 1 1 1 1 2 3 4 1 1 2 1 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 1 1 1 1 1 2 1 1 1 1 2 1 2 3 1 1 1 2 1 1 2 3 1 1 ...

output:

16501983

result:

ok single line: '16501983'

Test #23:

score: 0
Accepted
time: 31ms
memory: 43892kb

input:

587 479
1 1 1 1 1 1 2 3 4 1 2 3 1 2 1 2 3 4 1 1 6 1 1 1 1 2 1 1 1 2 5 1 1 2 1 1 1 1 1 2 1 1 2 1 1 1 1 1 1 2 3 4 5 6 1 2 1 2 1 1 1 1 1 1 1 4 5 1 1 1 1 1 2 3 1 2 1 1 1 1 1 1 2 1 1 2 3 4 5 6 1 1 2 5 6 7 1 1 1 2 3 4 5 6 7 1 1 2 3 1 2 3 1 1 1 1 1 2 1 1 1 2 1 1 2 1 2 1 1 1 1 1 2 1 1 1 1 1 1 1 2 1 1 1 1 4 ...

output:

1050750

result:

ok single line: '1050750'

Test #24:

score: 0
Accepted
time: 40ms
memory: 42988kb

input:

606 434
1 1 1 2 3 1 1 1 1 2 1 1 1 2 1 1 2 1 1 1 1 1 2 1 1 1 1 2 3 4 1 1 1 1 1 1 1 1 2 1 1 2 1 1 2 3 4 5 6 1 1 1 1 1 2 3 4 5 6 1 1 1 1 1 1 1 2 1 1 2 1 1 2 3 1 1 2 3 1 1 4 1 2 1 1 1 1 1 1 2 1 1 1 2 3 4 1 1 2 3 1 1 1 1 2 1 1 2 1 1 1 1 2 1 2 3 1 2 3 4 5 6 1 1 1 2 1 1 1 1 2 3 1 1 1 2 3 4 1 1 1 1 1 1 1 1 ...

output:

2497507

result:

ok single line: '2497507'

Test #25:

score: 0
Accepted
time: 40ms
memory: 55028kb

input:

619 660
1 1 1 1 2 1 1 1 2 3 6 7 1 2 3 4 1 2 1 2 1 1 1 1 1 1 2 3 4 1 4 5 1 1 1 1 2 1 1 1 2 1 2 3 1 2 3 1 4 1 1 2 1 2 1 1 1 8 9 1 2 1 2 3 4 1 2 1 1 1 1 2 1 1 1 2 3 1 1 2 1 2 3 1 1 2 3 1 2 1 1 2 3 4 1 1 2 3 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 5 1 2 1 1 1 1 1 2 1 1 1 2 3 1 1 2 1 1 1 2 1 2 3 4 5 1 1 1 1 2 1 ...

output:

2575280

result:

ok single line: '2575280'

Test #26:

score: 0
Accepted
time: 20ms
memory: 37548kb

input:

662 317
1 1 1 1 2 3 4 5 1 4 5 1 1 1 1 1 2 3 1 1 1 1 1 2 3 4 5 6 7 1 1 1 1 1 2 3 4 1 1 2 1 1 1 1 2 1 1 2 1 1 1 2 3 4 5 1 1 2 3 1 1 1 1 1 1 2 3 1 1 2 1 1 1 1 1 2 1 1 2 3 1 1 2 1 1 1 1 2 1 1 1 2 1 1 1 1 5 1 2 1 1 1 1 1 2 3 4 1 1 1 1 2 3 4 5 8 9 1 1 1 1 1 1 2 3 4 5 1 1 1 1 2 5 1 1 1 1 2 3 4 5 6 1 2 1 1 ...

output:

1208698

result:

ok single line: '1208698'

Test #27:

score: 0
Accepted
time: 58ms
memory: 57920kb

input:

675 774
1 2 3 4 1 1 2 1 1 1 1 2 3 4 1 1 1 2 1 1 2 3 4 5 1 2 1 2 1 1 1 1 1 1 5 6 7 8 9 10 1 2 3 1 1 1 1 2 1 1 1 1 1 1 1 1 1 2 1 1 2 3 4 5 6 1 1 1 2 3 1 1 2 1 1 2 1 2 1 1 1 1 1 1 1 1 1 2 3 4 1 1 1 4 5 1 1 2 1 1 1 1 2 3 4 1 1 2 1 1 2 1 1 7 8 1 2 3 4 1 2 3 1 2 3 4 5 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 1...

output:

5057023

result:

ok single line: '5057023'

Test #28:

score: 0
Accepted
time: 93ms
memory: 66568kb

input:

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

output:

2728795

result:

ok single line: '2728795'

Test #29:

score: 0
Accepted
time: 88ms
memory: 71748kb

input:

708 955
1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 1 1 2 1 1 2 3 4 5 1 1 1 2 1 2 1 1 1 2 1 1 4 5 6 7 8 1 1 1 1 1 2 7 6 1 1 1 1 1 2 1 1 2 3 1 2 1 2 5 6 1 2 1 1 1 2 1 1 1 2 3 1 2 1 1 1 2 1 1 1 1 1 2 1 1 2 1 1 1 1 1 1 2 1 1 1 2 1 1 1 1 1 1 2 1 1 1 2 3 1 2 1 1 1 1 1 4 1 1 1 1 1 1 2 3 1 1 2 3 4 5 1 1 1 2 3 6 1 2 3 ...

output:

5201757

result:

ok single line: '5201757'

Test #30:

score: 0
Accepted
time: 11ms
memory: 37492kb

input:

724 161
1 1 1 2 3 4 5 6 9 10 1 1 1 1 1 2 3 4 1 2 1 2 1 2 3 1 1 1 1 1 1 1 2 3 1 2 1 1 1 1 1 1 1 1 1 5 1 1 1 1 1 1 2 3 6 7 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 3 4 1 1 1 2 3 8 7 8 9 10 11 12 1 1 1 2 3 4 1 1 1 2 1 1 2 1 1 1 1 1 2 1 1 1 2 1 1 2 5 1 1 2 3 4 1 1 2 3 1 1 1 1 2 3 1 2 1 1 1 1 1 1 1 1 ...

output:

656364

result:

ok single line: '656364'

Test #31:

score: 0
Accepted
time: 34ms
memory: 41220kb

input:

737 386
1 1 2 3 1 1 1 1 1 2 1 2 1 1 1 2 3 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 2 5 6 1 1 1 2 3 4 1 1 1 1 2 1 1 1 1 2 1 1 2 1 2 1 2 1 1 2 1 2 1 1 1 1 1 1 1 1 1 1 2 3 6 1 1 2 3 1 1 1 1 1 1 2 1 1 1 2 1 2 3 4 5 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 2 3 1 2 3 1 1 2 1 1 1 ...

output:

809816

result:

ok single line: '809816'

Test #32:

score: 0
Accepted
time: 57ms
memory: 56580kb

input:

753 592
1 1 4 1 1 1 1 1 1 1 1 1 1 4 5 6 1 2 1 1 1 1 1 1 1 2 1 1 1 2 3 4 1 2 3 4 5 1 1 2 3 1 2 3 4 5 6 7 14 13 1 2 3 4 5 8 9 10 1 1 2 3 8 1 1 1 1 2 3 1 1 1 4 1 1 1 2 3 1 1 2 1 1 1 1 1 2 1 1 1 2 1 2 1 1 1 2 3 4 5 1 1 1 1 1 4 1 1 1 1 2 3 4 1 2 1 2 3 1 1 1 1 1 1 1 2 3 1 1 2 1 1 1 1 2 1 2 1 1 1 1 1 2 1 1...

output:

3580375

result:

ok single line: '3580375'

Test #33:

score: 0
Accepted
time: 113ms
memory: 100152kb

input:

1000 1000
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

482801872

result:

ok single line: '482801872'

Test #34:

score: 0
Accepted
time: 95ms
memory: 87512kb

input:

1000 1000
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

194088777

result:

ok single line: '194088777'