QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#353336#8271. SequenceDec0Dedd85 20ms8092kbC++141.3kb2024-03-14 03:10:032024-03-14 03:10:03

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 11
Accepted

Test #1:

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

input:

10
1
1
300
1
300
300
300
1
1
1

output:

1
2
302
3
303
602
902
4
5
6

result:

ok 10 lines

Test #2:

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

input:

5
2
3
5
8
11

output:

2
5
10
13
24

result:

ok 5 lines

Test #3:

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

input:

5
11
8
5
3
2

output:

11
19
24
22
24

result:

ok 5 lines

Test #4:

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

input:

10
923992
541947
567511
357324
813558
178420
173977
186266
158267
115992

output:

923992
1465939
2033450
1823263
2636821
2211870
2385847
2009529
2167796
2283788

result:

ok 10 lines

Test #5:

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

input:

10
7
9
9
5
10
5
9
3
1
3

output:

7
16
25
21
31
30
39
24
25
28

result:

ok 10 lines

Test #6:

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

input:

10
541685
317557
788550
628270
601073
863693
536
94813
86706
349169

output:

541685
859242
1647792
1487512
2088585
2511485
2512021
1582325
1669031
2018200

result:

ok 10 lines

Test #7:

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

input:

10
3
5
4
1
5
4
4
2
2
4

output:

3
8
12
9
14
16
20
11
13
17

result:

ok 10 lines

Test #8:

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

input:

10
1
1
1
1
1
1
1
1
1
1

output:

1
2
3
3
4
4
5
4
4
5

result:

ok 10 lines

Test #9:

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

input:

9
1
1
1
1
1
1
1
1
1

output:

1
2
3
3
4
4
5
4
4

result:

ok 9 lines

Test #10:

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

input:

7
1
1
6
1
1
1
1

output:

1
2
8
3
4
5
6

result:

ok 7 lines

Test #11:

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

input:

3
10
42
1

output:

10
52
53

result:

ok 3 lines

Subtask #2:

score: 10
Accepted

Test #12:

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

input:

1
1

output:

1

result:

ok single line: '1'

Test #13:

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

input:

5
1
1
1
1
1

output:

1
2
3
3
4

result:

ok 5 lines

Test #14:

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

input:

300
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
2
3
3
4
4
5
4
4
5
6
5
6
6
6
4
5
5
6
5
6
7
8
6
5
6
5
6
7
6
7
5
6
6
7
5
6
7
7
6
7
6
7
7
7
8
9
6
6
6
7
7
8
6
7
7
7
8
9
7
8
8
7
5
6
7
8
6
7
8
9
6
7
7
7
8
9
7
8
6
5
6
7
7
7
8
8
8
9
6
7
8
8
9
9
7
8
7
7
6
7
8
9
7
7
8
9
6
7
7
7
8
9
7
8
9
8
9
9
7
7
8
9
8
6
7
8
6
7
7
8
7
8
9
8
7
8
8
9
8
9
10
9
6
7
8
7
8
9
7...

result:

ok 300 lines

Test #15:

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

input:

11
1
1
1
1
1
1
1
1
1
1
1

output:

1
2
3
3
4
4
5
4
4
5
6

result:

ok 11 lines

Test #16:

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

input:

299
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
2
3
3
4
4
5
4
4
5
6
5
6
6
6
4
5
5
6
5
6
7
8
6
5
6
5
6
7
6
7
5
6
6
7
5
6
7
7
6
7
6
7
7
7
8
9
6
6
6
7
7
8
6
7
7
7
8
9
7
8
8
7
5
6
7
8
6
7
8
9
6
7
7
7
8
9
7
8
6
5
6
7
7
7
8
8
8
9
6
7
8
8
9
9
7
8
7
7
6
7
8
9
7
7
8
9
6
7
7
7
8
9
7
8
9
8
9
9
7
7
8
9
8
6
7
8
6
7
7
8
7
8
9
8
7
8
8
9
8
9
10
9
6
7
8
7
8
9
7...

result:

ok 299 lines

Subtask #3:

score: 10
Accepted

Dependency #2:

100%
Accepted

Test #17:

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

input:

1
1

output:

1

result:

ok single line: '1'

Test #18:

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

input:

5
1
1
1
1
1

output:

1
2
3
3
4

result:

ok 5 lines

Test #19:

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

input:

300
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
2
3
3
4
4
5
4
4
5
6
5
6
6
6
4
5
5
6
5
6
7
8
6
5
6
5
6
7
6
7
5
6
6
7
5
6
7
7
6
7
6
7
7
7
8
9
6
6
6
7
7
8
6
7
7
7
8
9
7
8
8
7
5
6
7
8
6
7
8
9
6
7
7
7
8
9
7
8
6
5
6
7
7
7
8
8
8
9
6
7
8
8
9
9
7
8
7
7
6
7
8
9
7
7
8
9
6
7
7
7
8
9
7
8
9
8
9
9
7
7
8
9
8
6
7
8
6
7
7
8
7
8
9
8
7
8
8
9
8
9
10
9
6
7
8
7
8
9
7...

result:

ok 300 lines

Test #20:

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

input:

11
1
1
1
1
1
1
1
1
1
1
1

output:

1
2
3
3
4
4
5
4
4
5
6

result:

ok 11 lines

Test #21:

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

input:

299
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
2
3
3
4
4
5
4
4
5
6
5
6
6
6
4
5
5
6
5
6
7
8
6
5
6
5
6
7
6
7
5
6
6
7
5
6
7
7
6
7
6
7
7
7
8
9
6
6
6
7
7
8
6
7
7
7
8
9
7
8
8
7
5
6
7
8
6
7
8
9
6
7
7
7
8
9
7
8
6
5
6
7
7
7
8
8
8
9
6
7
8
8
9
9
7
8
7
7
6
7
8
9
7
7
8
9
6
7
7
7
8
9
7
8
9
8
9
9
7
7
8
9
8
6
7
8
6
7
7
8
7
8
9
8
7
8
8
9
8
9
10
9
6
7
8
7
8
9
7...

result:

ok 299 lines

Test #22:

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

input:

300
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

2
4
6
6
8
8
10
8
8
10
12
10
12
12
12
8
10
10
12
10
12
14
16
12
10
12
10
12
14
12
14
10
12
12
14
10
12
14
14
12
14
12
14
14
14
16
18
12
12
12
14
14
16
12
14
14
14
16
18
14
16
16
14
10
12
14
16
12
14
16
18
12
14
14
14
16
18
14
16
12
10
12
14
14
14
16
16
16
18
12
14
16
16
18
18
14
16
14
14
12
14
16
18
...

result:

ok 300 lines

Test #23:

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

input:

300
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
...

output:

3
6
9
9
12
12
15
12
12
15
18
15
18
18
18
12
15
15
18
15
18
21
24
18
15
18
15
18
21
18
21
15
18
18
21
15
18
21
21
18
21
18
21
21
21
24
27
18
18
18
21
21
24
18
21
21
21
24
27
21
24
24
21
15
18
21
24
18
21
24
27
18
21
21
21
24
27
21
24
18
15
18
21
21
21
24
24
24
27
18
21
24
24
27
27
21
24
21
21
18
21
2...

result:

ok 300 lines

Test #24:

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

input:

300
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10...

output:

10
20
30
30
40
40
50
40
40
50
60
50
60
60
60
40
50
50
60
50
60
70
80
60
50
60
50
60
70
60
70
50
60
60
70
50
60
70
70
60
70
60
70
70
70
80
90
60
60
60
70
70
80
60
70
70
70
80
90
70
80
80
70
50
60
70
80
60
70
80
90
60
70
70
70
80
90
70
80
60
50
60
70
70
70
80
80
80
90
60
70
80
80
90
90
70
80
70
70
60
...

result:

ok 300 lines

Test #25:

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

input:

300
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
...

output:

100
200
300
300
400
400
500
400
400
500
600
500
600
600
600
400
500
500
600
500
600
700
800
600
500
600
500
600
700
600
700
500
600
600
700
500
600
700
700
600
700
600
700
700
700
800
900
600
600
600
700
700
800
600
700
700
700
800
900
700
800
800
700
500
600
700
800
600
700
800
900
600
700
700
700
...

result:

ok 300 lines

Test #26:

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

input:

300
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
...

output:

1000000
2000000
3000000
3000000
4000000
4000000
5000000
4000000
4000000
5000000
6000000
5000000
6000000
6000000
6000000
4000000
5000000
5000000
6000000
5000000
6000000
7000000
8000000
6000000
5000000
6000000
5000000
6000000
7000000
6000000
7000000
5000000
6000000
6000000
7000000
5000000
6000000
7000...

result:

ok 300 lines

Test #27:

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

input:

300
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
999999
99...

output:

999999
1999998
2999997
2999997
3999996
3999996
4999995
3999996
3999996
4999995
5999994
4999995
5999994
5999994
5999994
3999996
4999995
4999995
5999994
4999995
5999994
6999993
7999992
5999994
4999995
5999994
4999995
5999994
6999993
5999994
6999993
4999995
5999994
5999994
6999993
4999995
5999994
69999...

result:

ok 300 lines

Test #28:

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

input:

300
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
123456
12...

output:

123456
246912
370368
370368
493824
493824
617280
493824
493824
617280
740736
617280
740736
740736
740736
493824
617280
617280
740736
617280
740736
864192
987648
740736
617280
740736
617280
740736
864192
740736
864192
617280
740736
740736
864192
617280
740736
864192
864192
740736
864192
740736
864192...

result:

ok 300 lines

Test #29:

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

input:

300
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
392845
39...

output:

392845
785690
1178535
1178535
1571380
1571380
1964225
1571380
1571380
1964225
2357070
1964225
2357070
2357070
2357070
1571380
1964225
1964225
2357070
1964225
2357070
2749915
3142760
2357070
1964225
2357070
1964225
2357070
2749915
2357070
2749915
1964225
2357070
2357070
2749915
1964225
2357070
274991...

result:

ok 300 lines

Subtask #4:

score: 9
Accepted

Dependency #2:

100%
Accepted

Test #30:

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

input:

1
1

output:

1

result:

ok single line: '1'

Test #31:

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

input:

5
1
1
1
1
1

output:

1
2
3
3
4

result:

ok 5 lines

Test #32:

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

input:

300
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
2
3
3
4
4
5
4
4
5
6
5
6
6
6
4
5
5
6
5
6
7
8
6
5
6
5
6
7
6
7
5
6
6
7
5
6
7
7
6
7
6
7
7
7
8
9
6
6
6
7
7
8
6
7
7
7
8
9
7
8
8
7
5
6
7
8
6
7
8
9
6
7
7
7
8
9
7
8
6
5
6
7
7
7
8
8
8
9
6
7
8
8
9
9
7
8
7
7
6
7
8
9
7
7
8
9
6
7
7
7
8
9
7
8
9
8
9
9
7
7
8
9
8
6
7
8
6
7
7
8
7
8
9
8
7
8
8
9
8
9
10
9
6
7
8
7
8
9
7...

result:

ok 300 lines

Test #33:

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

input:

11
1
1
1
1
1
1
1
1
1
1
1

output:

1
2
3
3
4
4
5
4
4
5
6

result:

ok 11 lines

Test #34:

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

input:

299
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
2
3
3
4
4
5
4
4
5
6
5
6
6
6
4
5
5
6
5
6
7
8
6
5
6
5
6
7
6
7
5
6
6
7
5
6
7
7
6
7
6
7
7
7
8
9
6
6
6
7
7
8
6
7
7
7
8
9
7
8
8
7
5
6
7
8
6
7
8
9
6
7
7
7
8
9
7
8
6
5
6
7
7
7
8
8
8
9
6
7
8
8
9
9
7
8
7
7
6
7
8
9
7
7
8
9
6
7
7
7
8
9
7
8
9
8
9
9
7
7
8
9
8
6
7
8
6
7
7
8
7
8
9
8
7
8
8
9
8
9
10
9
6
7
8
7
8
9
7...

result:

ok 299 lines

Test #35:

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

input:

301
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
7
7
8
9
8
6
7
8
6
7
7
8
7
8
9
8
7
8
8
9
8
9
10
9
6
7
8
7
8
9
7...

result:

ok 1399 lines

Test #37:

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

input:

1400
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
2
3
3
4
4
5
4
4
5
6
5
6
6
6
4
5
5
6
5
6
7
8
6
5
6
5
6
7
6
7
5
6
6
7
5
6
7
7
6
7
6
7
7
7
8
9
6
6
6
7
7
8
6
7
7
7
8
9
7
8
8
7
5
6
7
8
6
7
8
9
6
7
7
7
8
9
7
8
6
5
6
7
7
7
8
8
8
9
6
7
8
8
9
9
7
8
7
7
6
7
8
9
7
7
8
9
6
7
7
7
8
9
7
8
9
8
9
9
7
7
8
9
8
6
7
8
6
7
7
8
7
8
9
8
7
8
8
9
8
9
10
9
6
7
8
7
8
9
7...

result:

ok 1400 lines

Subtask #5:

score: 45
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Test #38:

score: 45
Accepted
time: 0ms
memory: 3668kb

input:

10
1
1
300
1
300
300
300
1
1
1

output:

1
2
302
3
303
602
902
4
5
6

result:

ok 10 lines

Test #39:

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

input:

5
2
3
5
8
11

output:

2
5
10
13
24

result:

ok 5 lines

Test #40:

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

input:

5
11
8
5
3
2

output:

11
19
24
22
24

result:

ok 5 lines

Test #41:

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

input:

10
923992
541947
567511
357324
813558
178420
173977
186266
158267
115992

output:

923992
1465939
2033450
1823263
2636821
2211870
2385847
2009529
2167796
2283788

result:

ok 10 lines

Test #42:

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

input:

10
7
9
9
5
10
5
9
3
1
3

output:

7
16
25
21
31
30
39
24
25
28

result:

ok 10 lines

Test #43:

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

input:

10
541685
317557
788550
628270
601073
863693
536
94813
86706
349169

output:

541685
859242
1647792
1487512
2088585
2511485
2512021
1582325
1669031
2018200

result:

ok 10 lines

Test #44:

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

input:

10
3
5
4
1
5
4
4
2
2
4

output:

3
8
12
9
14
16
20
11
13
17

result:

ok 10 lines

Test #45:

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

input:

10
1
1
1
1
1
1
1
1
1
1

output:

1
2
3
3
4
4
5
4
4
5

result:

ok 10 lines

Test #46:

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

input:

9
1
1
1
1
1
1
1
1
1

output:

1
2
3
3
4
4
5
4
4

result:

ok 9 lines

Test #47:

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

input:

7
1
1
6
1
1
1
1

output:

1
2
8
3
4
5
6

result:

ok 7 lines

Test #48:

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

input:

1
1

output:

1

result:

ok single line: '1'

Test #49:

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

input:

5
1
1
1
1
1

output:

1
2
3
3
4

result:

ok 5 lines

Test #50:

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

input:

300
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
2
3
3
4
4
5
4
4
5
6
5
6
6
6
4
5
5
6
5
6
7
8
6
5
6
5
6
7
6
7
5
6
6
7
5
6
7
7
6
7
6
7
7
7
8
9
6
6
6
7
7
8
6
7
7
7
8
9
7
8
8
7
5
6
7
8
6
7
8
9
6
7
7
7
8
9
7
8
6
5
6
7
7
7
8
8
8
9
6
7
8
8
9
9
7
8
7
7
6
7
8
9
7
7
8
9
6
7
7
7
8
9
7
8
9
8
9
9
7
7
8
9
8
6
7
8
6
7
7
8
7
8
9
8
7
8
8
9
8
9
10
9
6
7
8
7
8
9
7...

result:

ok 300 lines

Test #51:

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

input:

11
1
1
1
1
1
1
1
1
1
1
1

output:

1
2
3
3
4
4
5
4
4
5
6

result:

ok 11 lines

Test #52:

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

input:

299
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
2
3
3
4
4
5
4
4
5
6
5
6
6
6
4
5
5
6
5
6
7
8
6
5
6
5
6
7
6
7
5
6
6
7
5
6
7
7
6
7
6
7
7
7
8
9
6
6
6
7
7
8
6
7
7
7
8
9
7
8
8
7
5
6
7
8
6
7
8
9
6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7
8
9
8
6
7
8
6
7
7
8
7
8
9
8
7
8
8
9
8
9
10
9
6
7
8
7
8
9
7...

result:

ok 1400 lines

Test #56:

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

input:

5000
70129
975035
45848
254946
861628
479219
357218
333562
905079
383680
536492
802874
450147
593434
408478
355022
848295
667869
37556
300142
628924
261168
729809
671097
250984
243132
598554
998041
417632
935409
451275
58472
291473
480225
742410
958982
680047
78640
400800
292834
818162
378438
607972...

output:

70129
1045164
1091012
1300110
2161738
1570231
1927449
1633672
1996091
2379771
2916263
2148832
2598979
2520883
2616064
1655132
2503427
2238100
2275656
2461880
2556373
2817541
3547350
2350617
2412722
2655854
2594645
3180436
3598068
3315180
3766455
1692144
1983617
2463842
3206252
2529213
3209260
235429...

result:

ok 5000 lines

Test #57:

score: 0
Accepted
time: 6ms
memory: 5012kb

input:

2047
1
1
1030
1
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
10...

output:

1
2
1032
3
1033
2062
3092
1033
2062
2063
3093
2063
3093
4122
3093
4
1034
2064
3094
2063
3093
4123
5153
3093
2063
3093
3092
4122
5152
3093
4123
1034
2064
2064
3094
3092
4122
4124
4123
3093
4123
4122
5152
4123
4123
5153
6183
2064
3094
3093
3094
4123
5153
4122
4123
5152
5152
6182
7212
4123
5153
5153
51...

result:

ok 2047 lines

Test #58:

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

input:

5000
960974
990745
961879
998618
944566
995811
990546
990635
960711
947236
900025
931426
954054
910921
989346
956651
951708
929159
946500
992198
944279
991362
915819
984415
950930
992891
909100
908013
951488
915107
952374
998687
992899
936928
928383
971113
983389
908442
935462
996988
926260
964195
9...

output:

960974
1951719
2913598
2950337
3894903
3909409
4899955
3940972
3874309
4821545
5721570
4840835
5794889
5810876
5846128
3906988
4858696
4803468
5749968
4887101
5831380
6712932
7628751
5825250
4845833
5838724
4783409
5691422
6642910
5736652
6689026
4905675
5898574
5795624
6724007
4880522
5863911
66584...

result:

ok 5000 lines

Test #59:

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

input:

5000
218
50
928
278
191
514
729
642
735
466
669
557
845
401
710
622
747
468
954
725
537
926
591
613
861
801
808
747
671
150
793
837
30
141
819
647
653
449
824
66
902
944
432
454
352
359
920
801
912
869
472
475
914
133
681
443
771
963
108
779
445
144
586
61
5
372
345
973
514
731
453
814
477
801
43
54...

output:

218
268
1196
546
737
1251
1980
1188
1923
1203
1872
1808
2653
2381
2375
1168
1915
2178
3132
1462
1999
2798
3389
1864
1598
2399
2739
2727
3398
1401
2194
2005
2035
2056
2799
1898
2551
3000
3700
1269
2171
2924
3356
2326
2466
2825
3745
2609
2892
2072
2544
2874
3788
2311
2553
2824
3595
4361
4469
2180
2625...

result:

ok 5000 lines

Test #60:

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

input:

5000
8
6
1
6
3
3
9
10
3
4
9
3
2
9
1
4
7
4
7
1
4
5
9
5
2
9
1
7
6
9
8
3
10
6
6
4
10
3
3
5
5
10
4
7
3
2
6
6
10
9
2
4
2
2
9
5
4
2
1
6
7
6
8
1
10
1
1
7
1
9
3
3
9
8
2
9
4
2
5
9
4
3
7
10
9
5
9
7
5
7
4
1
7
5
2
5
2
8
4
10
6
10
6
5
8
10
7
4
6
8
9
4
9
6
5
10
6
2
7
10
3
4
3
7
6
8
7
8
2
9
2
10
8
8
1
6
9
3
4
5
4
...

output:

8
14
15
20
23
18
27
30
18
22
31
21
23
32
25
24
31
22
29
23
27
32
41
26
25
32
19
26
32
31
39
27
37
37
41
22
32
32
26
28
33
37
41
39
28
30
36
30
37
34
34
30
32
21
30
31
33
34
35
29
36
42
35
25
35
33
34
38
39
43
46
24
33
40
27
36
40
25
30
33
22
25
32
36
43
46
41
40
45
29
33
31
38
41
40
33
35
43
35
32
3...

result:

ok 5000 lines

Test #61:

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

input:

5000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
2
3
3
4
4
5
4
4
5
6
5
6
6
6
4
5
5
6
5
6
7
8
6
5
6
5
6
7
6
7
5
6
6
7
5
6
7
7
6
7
6
7
7
7
8
9
6
6
6
7
7
8
6
7
7
7
8
9
7
8
8
7
5
6
7
8
6
7
8
9
6
7
7
7
8
9
7
8
6
5
6
7
7
7
8
8
8
9
6
7
8
8
9
9
7
8
7
7
6
7
8
9
7
7
8
9
6
7
7
7
8
9
7
8
9
8
9
9
7
7
8
9
8
6
7
8
6
7
7
8
7
8
9
8
7
8
8
9
8
9
10
9
6
7
8
7
8
9
7...

result:

ok 5000 lines

Test #62:

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

input:

5000
104
102
103
103
104
105
101
105
104
104
102
105
101
101
103
100
105
102
101
101
102
100
100
104
101
103
102
102
102
104
102
103
102
100
102
103
104
100
105
102
100
102
103
101
105
100
103
105
103
100
103
105
103
100
104
104
105
103
101
100
103
102
104
100
105
102
103
105
102
104
104
101
104
103...

output:

104
206
309
309
413
414
515
414
413
517
619
517
618
616
619
409
514
515
616
514
616
716
816
621
514
617
515
617
719
621
723
512
614
614
716
517
621
716
723
616
716
617
720
720
724
824
927
617
618
614
717
722
825
615
719
721
721
822
923
717
820
825
721
509
614
716
819
619
721
820
924
618
722
724
721
...

result:

ok 5000 lines

Test #63:

score: 0
Accepted
time: 15ms
memory: 8004kb

input:

5000
1045
1026
1005
1031
1031
1039
1019
1027
1014
1015
1003
1049
1004
1003
1038
1002
1016
1038
1013
1026
1034
1011
1018
1017
1039
1020
1001
1021
1031
1003
1020
1036
1002
1009
1002
1035
1029
1020
1005
1009
1002
1014
1003
1045
1048
1037
1030
1015
1016
1038
1050
1041
1039
1038
1039
1044
1004
1045
1047
...

output:

1045
2071
3076
3102
4133
4115
5134
4129
4090
5105
6108
5156
6160
6137
6176
4104
5120
5128
6141
5159
6168
7119
8137
6151
5172
6192
5091
6112
7143
6108
7128
5140
6142
6129
7131
5150
6179
7161
7165
6157
7159
6148
7151
7196
7200
8237
9267
6124
6150
6186
7175
7201
8240
6129
7168
7156
7145
8188
9235
7118
...

result:

ok 5000 lines

Test #64:

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

input:

4999
1031
1048
1025
1029
1030
1047
1010
1006
1042
1020
1005
1026
1023
1011
1007
1011
1043
1004
1043
1002
1027
1025
1040
1042
1023
1044
1027
1008
1036
1029
1020
1005
1045
1043
1003
1047
1035
1026
1019
1004
1048
1019
1022
1020
1003
1032
1041
1021
1037
1030
1025
1032
1030
1029
1020
1041
1015
1005
1039
...

output:

1031
2079
3104
3108
4138
4151
5161
4114
4146
5158
6163
5159
6182
6172
6170
4119
5162
5150
6193
5140
6167
7188
8228
6181
5161
6205
5173
6181
7217
6195
7215
5119
6164
6205
7198
5198
6233
7219
7201
6144
7192
6180
7202
7183
7173
8205
9246
6165
6198
6188
7212
7214
8244
6179
7183
7208
7208
8213
9252
7196
...

result:

ok 4999 lines

Test #65:

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

input:

3
10
42
1

output:

10
52
53

result:

ok 3 lines

Subtask #6:

score: 0
Runtime Error

Dependency #5:

100%
Accepted

Test #66:

score: 15
Accepted
time: 0ms
memory: 3928kb

input:

10
1
1
300
1
300
300
300
1
1
1

output:

1
2
302
3
303
602
902
4
5
6

result:

ok 10 lines

Test #67:

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

input:

5
2
3
5
8
11

output:

2
5
10
13
24

result:

ok 5 lines

Test #68:

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

input:

5
11
8
5
3
2

output:

11
19
24
22
24

result:

ok 5 lines

Test #69:

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

input:

10
923992
541947
567511
357324
813558
178420
173977
186266
158267
115992

output:

923992
1465939
2033450
1823263
2636821
2211870
2385847
2009529
2167796
2283788

result:

ok 10 lines

Test #70:

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

input:

10
7
9
9
5
10
5
9
3
1
3

output:

7
16
25
21
31
30
39
24
25
28

result:

ok 10 lines

Test #71:

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

input:

10
541685
317557
788550
628270
601073
863693
536
94813
86706
349169

output:

541685
859242
1647792
1487512
2088585
2511485
2512021
1582325
1669031
2018200

result:

ok 10 lines

Test #72:

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

input:

10
3
5
4
1
5
4
4
2
2
4

output:

3
8
12
9
14
16
20
11
13
17

result:

ok 10 lines

Test #73:

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

input:

10
1
1
1
1
1
1
1
1
1
1

output:

1
2
3
3
4
4
5
4
4
5

result:

ok 10 lines

Test #74:

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

input:

9
1
1
1
1
1
1
1
1
1

output:

1
2
3
3
4
4
5
4
4

result:

ok 9 lines

Test #75:

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

input:

7
1
1
6
1
1
1
1

output:

1
2
8
3
4
5
6

result:

ok 7 lines

Test #76:

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

input:

1
1

output:

1

result:

ok single line: '1'

Test #77:

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

input:

5
1
1
1
1
1

output:

1
2
3
3
4

result:

ok 5 lines

Test #78:

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

input:

300
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
2
3
3
4
4
5
4
4
5
6
5
6
6
6
4
5
5
6
5
6
7
8
6
5
6
5
6
7
6
7
5
6
6
7
5
6
7
7
6
7
6
7
7
7
8
9
6
6
6
7
7
8
6
7
7
7
8
9
7
8
8
7
5
6
7
8
6
7
8
9
6
7
7
7
8
9
7
8
6
5
6
7
7
7
8
8
8
9
6
7
8
8
9
9
7
8
7
7
6
7
8
9
7
7
8
9
6
7
7
7
8
9
7
8
9
8
9
9
7
7
8
9
8
6
7
8
6
7
7
8
7
8
9
8
7
8
8
9
8
9
10
9
6
7
8
7
8
9
7...

result:

ok 300 lines

Test #79:

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

input:

11
1
1
1
1
1
1
1
1
1
1
1

output:

1
2
3
3
4
4
5
4
4
5
6

result:

ok 11 lines

Test #80:

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

input:

299
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
2
3
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
8
6
7
7
7
8
9
7
8
8
7
5
6
7
8
6
7
8
9
6
7
7
7
8
9
7
8
6
5
6
7
7
7
8
8
8
9
6
7
8
8
9
9
7
8
7
7
6
7
8
9
7
7
8
9
6
7
7
7
8
9
7
8
9
8
9
9
7
7
8
9
8
6
7
8
6
7
7
8
7
8
9
8
7
8
8
9
8
9
10
9
6
7
8
7
8
9
7...

result:

ok 1400 lines

Test #84:

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

input:

5000
70129
975035
45848
254946
861628
479219
357218
333562
905079
383680
536492
802874
450147
593434
408478
355022
848295
667869
37556
300142
628924
261168
729809
671097
250984
243132
598554
998041
417632
935409
451275
58472
291473
480225
742410
958982
680047
78640
400800
292834
818162
378438
607972...

output:

70129
1045164
1091012
1300110
2161738
1570231
1927449
1633672
1996091
2379771
2916263
2148832
2598979
2520883
2616064
1655132
2503427
2238100
2275656
2461880
2556373
2817541
3547350
2350617
2412722
2655854
2594645
3180436
3598068
3315180
3766455
1692144
1983617
2463842
3206252
2529213
3209260
235429...

result:

ok 5000 lines

Test #85:

score: 0
Accepted
time: 6ms
memory: 5028kb

input:

2047
1
1
1030
1
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
1030
10...

output:

1
2
1032
3
1033
2062
3092
1033
2062
2063
3093
2063
3093
4122
3093
4
1034
2064
3094
2063
3093
4123
5153
3093
2063
3093
3092
4122
5152
3093
4123
1034
2064
2064
3094
3092
4122
4124
4123
3093
4123
4122
5152
4123
4123
5153
6183
2064
3094
3093
3094
4123
5153
4122
4123
5152
5152
6182
7212
4123
5153
5153
51...

result:

ok 2047 lines

Test #86:

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

input:

5000
960974
990745
961879
998618
944566
995811
990546
990635
960711
947236
900025
931426
954054
910921
989346
956651
951708
929159
946500
992198
944279
991362
915819
984415
950930
992891
909100
908013
951488
915107
952374
998687
992899
936928
928383
971113
983389
908442
935462
996988
926260
964195
9...

output:

960974
1951719
2913598
2950337
3894903
3909409
4899955
3940972
3874309
4821545
5721570
4840835
5794889
5810876
5846128
3906988
4858696
4803468
5749968
4887101
5831380
6712932
7628751
5825250
4845833
5838724
4783409
5691422
6642910
5736652
6689026
4905675
5898574
5795624
6724007
4880522
5863911
66584...

result:

ok 5000 lines

Test #87:

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

input:

5000
218
50
928
278
191
514
729
642
735
466
669
557
845
401
710
622
747
468
954
725
537
926
591
613
861
801
808
747
671
150
793
837
30
141
819
647
653
449
824
66
902
944
432
454
352
359
920
801
912
869
472
475
914
133
681
443
771
963
108
779
445
144
586
61
5
372
345
973
514
731
453
814
477
801
43
54...

output:

218
268
1196
546
737
1251
1980
1188
1923
1203
1872
1808
2653
2381
2375
1168
1915
2178
3132
1462
1999
2798
3389
1864
1598
2399
2739
2727
3398
1401
2194
2005
2035
2056
2799
1898
2551
3000
3700
1269
2171
2924
3356
2326
2466
2825
3745
2609
2892
2072
2544
2874
3788
2311
2553
2824
3595
4361
4469
2180
2625...

result:

ok 5000 lines

Test #88:

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

input:

5000
8
6
1
6
3
3
9
10
3
4
9
3
2
9
1
4
7
4
7
1
4
5
9
5
2
9
1
7
6
9
8
3
10
6
6
4
10
3
3
5
5
10
4
7
3
2
6
6
10
9
2
4
2
2
9
5
4
2
1
6
7
6
8
1
10
1
1
7
1
9
3
3
9
8
2
9
4
2
5
9
4
3
7
10
9
5
9
7
5
7
4
1
7
5
2
5
2
8
4
10
6
10
6
5
8
10
7
4
6
8
9
4
9
6
5
10
6
2
7
10
3
4
3
7
6
8
7
8
2
9
2
10
8
8
1
6
9
3
4
5
4
...

output:

8
14
15
20
23
18
27
30
18
22
31
21
23
32
25
24
31
22
29
23
27
32
41
26
25
32
19
26
32
31
39
27
37
37
41
22
32
32
26
28
33
37
41
39
28
30
36
30
37
34
34
30
32
21
30
31
33
34
35
29
36
42
35
25
35
33
34
38
39
43
46
24
33
40
27
36
40
25
30
33
22
25
32
36
43
46
41
40
45
29
33
31
38
41
40
33
35
43
35
32
3...

result:

ok 5000 lines

Test #89:

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

input:

5000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
2
3
3
4
4
5
4
4
5
6
5
6
6
6
4
5
5
6
5
6
7
8
6
5
6
5
6
7
6
7
5
6
6
7
5
6
7
7
6
7
6
7
7
7
8
9
6
6
6
7
7
8
6
7
7
7
8
9
7
8
8
7
5
6
7
8
6
7
8
9
6
7
7
7
8
9
7
8
6
5
6
7
7
7
8
8
8
9
6
7
8
8
9
9
7
8
7
7
6
7
8
9
7
7
8
9
6
7
7
7
8
9
7
8
9
8
9
9
7
7
8
9
8
6
7
8
6
7
7
8
7
8
9
8
7
8
8
9
8
9
10
9
6
7
8
7
8
9
7...

result:

ok 5000 lines

Test #90:

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

input:

5000
104
102
103
103
104
105
101
105
104
104
102
105
101
101
103
100
105
102
101
101
102
100
100
104
101
103
102
102
102
104
102
103
102
100
102
103
104
100
105
102
100
102
103
101
105
100
103
105
103
100
103
105
103
100
104
104
105
103
101
100
103
102
104
100
105
102
103
105
102
104
104
101
104
103...

output:

104
206
309
309
413
414
515
414
413
517
619
517
618
616
619
409
514
515
616
514
616
716
816
621
514
617
515
617
719
621
723
512
614
614
716
517
621
716
723
616
716
617
720
720
724
824
927
617
618
614
717
722
825
615
719
721
721
822
923
717
820
825
721
509
614
716
819
619
721
820
924
618
722
724
721
...

result:

ok 5000 lines

Test #91:

score: 0
Accepted
time: 15ms
memory: 7856kb

input:

5000
1045
1026
1005
1031
1031
1039
1019
1027
1014
1015
1003
1049
1004
1003
1038
1002
1016
1038
1013
1026
1034
1011
1018
1017
1039
1020
1001
1021
1031
1003
1020
1036
1002
1009
1002
1035
1029
1020
1005
1009
1002
1014
1003
1045
1048
1037
1030
1015
1016
1038
1050
1041
1039
1038
1039
1044
1004
1045
1047
...

output:

1045
2071
3076
3102
4133
4115
5134
4129
4090
5105
6108
5156
6160
6137
6176
4104
5120
5128
6141
5159
6168
7119
8137
6151
5172
6192
5091
6112
7143
6108
7128
5140
6142
6129
7131
5150
6179
7161
7165
6157
7159
6148
7151
7196
7200
8237
9267
6124
6150
6186
7175
7201
8240
6129
7168
7156
7145
8188
9235
7118
...

result:

ok 5000 lines

Test #92:

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

input:

4999
1031
1048
1025
1029
1030
1047
1010
1006
1042
1020
1005
1026
1023
1011
1007
1011
1043
1004
1043
1002
1027
1025
1040
1042
1023
1044
1027
1008
1036
1029
1020
1005
1045
1043
1003
1047
1035
1026
1019
1004
1048
1019
1022
1020
1003
1032
1041
1021
1037
1030
1025
1032
1030
1029
1020
1041
1015
1005
1039
...

output:

1031
2079
3104
3108
4138
4151
5161
4114
4146
5158
6163
5159
6182
6172
6170
4119
5162
5150
6193
5140
6167
7188
8228
6181
5161
6205
5173
6181
7217
6195
7215
5119
6164
6205
7198
5198
6233
7219
7201
6144
7192
6180
7202
7183
7173
8205
9246
6165
6198
6188
7212
7214
8244
6179
7183
7208
7208
8213
9252
7196
...

result:

ok 4999 lines

Test #93:

score: -15
Runtime Error

input:

16383
1
1
8201
1
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
1
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8201
8...

output:


result: