QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#189697#7057. Digital Pathnew_dawn_2#AC ✓221ms523612kbC++201.6kb2023-09-27 19:45:472023-09-27 19:45:49

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 104ms
memory: 476908kb

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: 100ms
memory: 478068kb

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: 221ms
memory: 523612kb

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: 96ms
memory: 478964kb

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: 121ms
memory: 486784kb

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: 128ms
memory: 481336kb

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: 132ms
memory: 488840kb

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: 104ms
memory: 485200kb

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: 110ms
memory: 486876kb

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: 114ms
memory: 487320kb

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: 123ms
memory: 488660kb

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: 115ms
memory: 485732kb

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: 120ms
memory: 491896kb

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: 109ms
memory: 485288kb

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: 121ms
memory: 490276kb

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: 123ms
memory: 487432kb

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: 126ms
memory: 492312kb

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: 119ms
memory: 490796kb

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: 149ms
memory: 497120kb

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: 111ms
memory: 488144kb

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: 129ms
memory: 487884kb

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: 144ms
memory: 498248kb

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: 125ms
memory: 492984kb

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: 125ms
memory: 492552kb

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: 146ms
memory: 496508kb

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: 112ms
memory: 491972kb

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: 182ms
memory: 500460kb

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: 189ms
memory: 503296kb

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: 174ms
memory: 503292kb

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: 126ms
memory: 489160kb

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: 134ms
memory: 494624kb

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: 148ms
memory: 499736kb

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: 212ms
memory: 514060kb

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: 185ms
memory: 513264kb

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'