QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#296477#6339. Cookieshyforces100 ✓459ms885096kbC++204.7kb2024-01-03 04:36:362024-01-03 04:36:36

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 6
Accepted

Test #1:

score: 6
Accepted
time: 24ms
memory: 883748kb

input:

1
1
1
1

output:

1
1 1 

result:

ok good!

Test #2:

score: 0
Accepted
time: 47ms
memory: 883856kb

input:

2
1 1
1
1

output:

2
1 1 
1 2 

result:

ok good!

Test #3:

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

input:

2
1 1
1
2

output:

1
2 1 2 

result:

ok good!

Test #4:

score: 0
Accepted
time: 28ms
memory: 883872kb

input:

2
1 1
2
1 2

output:

1
2 1 2 

result:

ok good!

Test #5:

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

input:

4
1 1 1 1
2
2 3

output:

2
2 1 2 
2 3 4 

result:

ok good!

Test #6:

score: 0
Accepted
time: 28ms
memory: 883856kb

input:

8
1 1 1 1 1 1 1 1
3
1 4 5

output:

2
4 1 2 3 4 
4 5 6 7 8 

result:

ok good!

Test #7:

score: 0
Accepted
time: 28ms
memory: 883892kb

input:

500
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

500
1 1 
1 2 
1 3 
1 4 
1 5 
1 6 
1 7 
1 8 
1 9 
1 10 
1 11 
1 12 
1 13 
1 14 
1 15 
1 16 
1 17 
1 18 
1 19 
1 20 
1 21 
1 22 
1 23 
1 24 
1 25 
1 26 
1 27 
1 28 
1 29 
1 30 
1 31 
1 32 
1 33 
1 34 
1 35 
1 36 
1 37 
1 38 
1 39 
1 40 
1 41 
1 42 
1 43 
1 44 
1 45 
1 46 
1 47 
1 48 
1 49 
1 50 
1 51 ...

result:

ok good!

Test #8:

score: 0
Accepted
time: 51ms
memory: 884060kb

input:

500
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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
500 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 10...

result:

ok good!

Test #9:

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

input:

500
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

2
1 1 
499 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100...

result:

ok good!

Test #10:

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

input:

500
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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

result:

ok no solution

Test #11:

score: 0
Accepted
time: 27ms
memory: 883920kb

input:

500
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

11
40 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 
46 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 
46 87 88 89 90 91 92 93 94 95 96 97 98 9...

result:

ok good!

Test #12:

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

input:

500
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

250
2 1 2 
2 3 4 
2 5 6 
2 7 8 
2 9 10 
2 11 12 
2 13 14 
2 15 16 
2 17 18 
2 19 20 
2 21 22 
2 23 24 
2 25 26 
2 27 28 
2 29 30 
2 31 32 
2 33 34 
2 35 36 
2 37 38 
2 39 40 
2 41 42 
2 43 44 
2 45 46 
2 47 48 
2 49 50 
2 51 52 
2 53 54 
2 55 56 
2 57 58 
2 59 60 
2 61 62 
2 63 64 
2 65 66 
2 67 68 ...

result:

ok good!

Test #13:

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

input:

484
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

22
22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 
22 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 
22 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 
22 89 90 91 92 93 94 95 96...

result:

ok good!

Test #14:

score: 0
Accepted
time: 43ms
memory: 883968kb

input:

495
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

55
9 1 2 3 4 5 6 7 8 9 
9 10 11 12 13 14 15 16 17 18 
9 19 20 21 22 23 24 25 26 27 
9 28 29 30 31 32 33 34 35 36 
9 37 38 39 40 41 42 43 44 45 
9 46 47 48 49 50 51 52 53 54 
9 55 56 57 58 59 60 61 62 63 
9 64 65 66 67 68 69 70 71 72 
9 73 74 75 76 77 78 79 80 81 
9 82 83 84 85 86 87 88 89 90 
9 91 9...

result:

ok good!

Test #15:

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

input:

500
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

4
125 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 10...

result:

ok good!

Test #16:

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

input:

499
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

27
5 1 2 3 4 5 
5 6 7 8 9 10 
5 11 12 13 14 15 
5 16 17 18 19 20 
17 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 
21 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 
21 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 
21 80 81 82 83 84 85 86 87 88 89 90 91 92 93 ...

result:

ok good!

Test #17:

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

input:

499
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

19
13 1 2 3 4 5 6 7 8 9 10 11 12 13 
27 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 
27 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 
27 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 
27 95 96...

result:

ok good!

Test #18:

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

input:

499
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

7
18 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 
64 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 
65 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99...

result:

ok good!

Test #19:

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

input:

499
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

4
56 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100...

result:

ok good!

Test #20:

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

input:

499
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

2
11 1 2 3 4 5 6 7 8 9 10 11 
488 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...

result:

ok good!

Test #21:

score: 0
Accepted
time: 48ms
memory: 884000kb

input:

499
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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

result:

ok no solution

Test #22:

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

input:

499
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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

result:

ok no solution

Test #23:

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

input:

493
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

17
1 1 
1 2 
1 3 
1 4 
1 5 
1 6 
1 7 
1 8 
1 9 
1 10 
1 11 
1 12 
1 13 
1 14 
1 15 
1 16 
477 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85...

result:

ok good!

Test #24:

score: 0
Accepted
time: 28ms
memory: 883892kb

input:

493
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

17
1 1 
1 2 
1 3 
1 4 
1 5 
1 6 
1 7 
1 8 
1 9 
1 10 
1 11 
1 12 
1 13 
1 14 
1 15 
1 16 
477 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85...

result:

ok good!

Test #25:

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

input:

493
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

17
16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 
16 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 
16 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 
16 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 
16 81 82 83 84 85 86 87 88 89 90 91 92 93 94 9...

result:

ok good!

Test #26:

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

input:

493
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

17
16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 
16 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 
16 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 
16 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 
16 81 82 83 84 85 86 87 88 89 90 91 92 93 94 9...

result:

ok good!

Test #27:

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

input:

493
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

17
16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 
16 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 
16 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 
16 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 
16 81 82 83 84 85 86 87 88 89 90 91 92 93 94 9...

result:

ok good!

Subtask #2:

score: 7
Accepted

Test #28:

score: 7
Accepted
time: 8ms
memory: 883796kb

input:

1
15
1
1

output:

15
1 1 
1 1 
1 1 
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 good!

Test #29:

score: 0
Accepted
time: 43ms
memory: 883872kb

input:

1
500
1
1

output:

500
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 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 good!

Test #30:

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

input:

1
3000
1
1

output:

3000
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
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 good!

Test #31:

score: 0
Accepted
time: 44ms
memory: 884032kb

input:

1
15000
1
1

output:

15000
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
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 good!

Test #32:

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

input:

2
2 1
1
1

output:

3
1 1 
1 1 
1 2 

result:

ok good!

Test #33:

score: 0
Accepted
time: 28ms
memory: 883928kb

input:

2
1 2
1
2

output:

-1

result:

ok no solution

Test #34:

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

input:

3
1 2 3
1
2

output:

3
2 3 2 
2 3 1 
2 2 3 

result:

ok good!

Test #35:

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

input:

3
3 2 1
1
3

output:

-1

result:

ok no solution

Test #36:

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

input:

3
2 2 2
1
2

output:

3
2 1 2 
2 3 1 
2 2 3 

result:

ok good!

Test #37:

score: 0
Accepted
time: 24ms
memory: 883808kb

input:

15
50 49 48 47 46 45 44 43 42 41 40 2 1 1 1
1
10

output:

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

result:

ok good!

Test #38:

score: 0
Accepted
time: 43ms
memory: 883740kb

input:

15
51 49 48 47 46 45 44 43 42 41 40 1 1 1 1
1
10

output:

-1

result:

ok no solution

Test #39:

score: 0
Accepted
time: 24ms
memory: 883888kb

input:

10
430 3078 390 349 3750 906 377 3374 1795 551
1
4

output:

3750
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9 
4 5 8 2 9...

result:

ok good!

Test #40:

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

input:

500
4 99 56 16 7 39 5 8 3 18 15 30 19 27 46 47 24 55 1 7 21 1 13 5 53 32 12 98 12 121 3 118 25 15 8 32 29 7 13 3 29 94 22 4 12 37 15 52 14 9 59 22 3 16 9 77 5 17 41 22 16 6 3 32 33 34 18 1 28 4 72 4 3 40 21 13 22 16 42 77 2 16 1 1 10 11 3 34 21 28 4 173 24 57 17 9 20 116 21 72 17 165 28 30 6 13 86 1...

output:

5000
3 238 92 383 
3 238 92 251 
3 238 92 383 
3 238 92 251 
3 238 383 92 
3 238 251 383 
3 238 92 211 
3 238 251 383 
3 238 92 211 
3 238 251 383 
3 238 92 211 
3 238 251 383 
3 238 92 102 
3 238 211 251 
3 238 383 92 
3 238 102 211 
3 238 251 383 
3 238 92 102 
3 238 211 251 
3 238 383 92 
3 238 1...

result:

ok good!

Test #41:

score: 0
Accepted
time: 44ms
memory: 883992kb

input:

500
30 23 12 48 4 11 119 12 15 24 33 9 22 46 42 7 18 49 9 1 43 3 4 43 31 11 4 7 33 30 13 5 36 3 20 2 40 37 7 1 8 43 34 12 2 37 99 38 59 36 24 18 68 23 9 24 33 1 13 10 12 2 7 7 1 5 73 7 7 32 2 13 7 49 41 20 160 69 11 61 25 35 15 22 32 66 47 45 34 14 12 7 9 43 4 42 2 24 29 16 11 6 5 5 8 11 42 3 48 20 ...

output:

200
75 496 284 77 297 336 316 7 470 435 489 195 447 319 196 264 265 47 335 389 197 200 449 434 366 233 131 144 401 223 446 238 484 397 474 303 383 433 67 115 391 114 236 305 355 398 78 368 442 53 116 163 404 443 86 226 364 458 493 497 127 327 467 267 388 80 465 126 175 49 209 274 381 407 121 298 
75...

result:

ok good!

Test #42:

score: 0
Accepted
time: 24ms
memory: 884024kb

input:

500
6 60 24 11 17 58 8 42 30 60 38 34 54 23 5 12 32 6 35 11 60 42 35 60 25 60 37 40 5 22 24 26 17 17 60 21 7 29 13 7 56 12 8 16 8 20 11 60 12 60 32 56 30 55 12 23 26 60 60 6 18 60 60 21 21 16 28 23 60 9 16 4 8 5 20 4 60 59 39 20 8 27 8 7 6 8 10 30 18 15 60 60 41 48 17 24 17 60 10 42 6 13 22 21 14 18...

output:

60
250 2 10 21 24 26 35 48 50 58 59 62 63 69 77 91 92 98 108 128 129 131 137 139 144 146 147 159 170 178 180 187 196 197 200 213 223 226 234 241 242 246 248 253 272 273 280 283 289 290 292 302 306 314 321 325 329 330 339 342 353 359 363 383 388 396 400 418 420 421 425 426 439 446 450 452 455 460 466...

result:

ok good!

Test #43:

score: 0
Accepted
time: 32ms
memory: 883812kb

input:

122
121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 ...

output:

122
121 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

result:

ok good!

Test #44:

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

input:

498
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:

3
332 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 10...

result:

ok good!

Subtask #3:

score: 12
Accepted

Test #45:

score: 12
Accepted
time: 35ms
memory: 883856kb

input:

2
7 8
2
1 2

output:

8
1 2 
2 1 2 
2 1 2 
2 1 2 
2 1 2 
2 1 2 
2 1 2 
2 1 2 

result:

ok good!

Test #46:

score: 0
Accepted
time: 28ms
memory: 884080kb

input:

3
5 4 6
2
2 3

output:

6
2 3 1 
2 3 1 
2 2 3 
3 1 2 3 
3 1 2 3 
3 1 2 3 

result:

ok good!

Test #47:

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

input:

3
4 2 9
3
1 2 3

output:

9
1 3 
1 3 
1 3 
1 3 
1 3 
2 1 3 
2 1 3 
3 1 2 3 
3 1 2 3 

result:

ok good!

Test #48:

score: 0
Accepted
time: 28ms
memory: 883892kb

input:

4
3 5 4 3
2
3 4

output:

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

result:

ok good!

Test #49:

score: 0
Accepted
time: 24ms
memory: 883924kb

input:

4
1 4 5 5
3
1 3 4

output:

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

result:

ok good!

Test #50:

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

input:

4
3 3 6 3
3
2 3 4

output:

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

result:

ok good!

Test #51:

score: 0
Accepted
time: 27ms
memory: 883860kb

input:

5
4 3 3 3 1
3
2 4 5

output:

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

result:

ok good!

Test #52:

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

input:

5
4 3 3 3 2
3
3 4 5

output:

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

result:

ok good!

Test #53:

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

input:

5
4 4 4 2 1
3
2 4 5

output:

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

result:

ok good!

Test #54:

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

input:

5
3 3 3 3 3
3
1 2 4

output:

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

result:

ok good!

Test #55:

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

input:

6
3 3 3 2 2 2
3
2 4 6

output:

-1

result:

ok no solution

Test #56:

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

input:

6
3 3 3 2 2 2
3
2 5 6

output:

3
5 1 2 3 4 5 
5 1 2 3 6 4 
5 1 2 3 5 6 

result:

ok good!

Test #57:

score: 0
Accepted
time: 27ms
memory: 884052kb

input:

6
4 4 3 2 1 1
3
1 3 5

output:

5
1 1 
1 2 
3 1 2 3 
5 1 2 3 4 5 
5 1 2 3 4 6 

result:

ok good!

Test #58:

score: 0
Accepted
time: 23ms
memory: 883980kb

input:

6
7 2 2 2 1 1
5
2 3 4 5 6

output:

7
2 1 2 
2 1 3 
2 1 4 
2 1 2 
2 1 3 
2 1 4 
3 1 5 6 

result:

ok good!

Test #59:

score: 0
Accepted
time: 23ms
memory: 883804kb

input:

7
3 3 3 2 2 1 1
3
1 4 6

output:

4
1 1 
4 2 3 1 4 
4 2 3 5 1 
6 2 3 4 5 6 7 

result:

ok good!

Test #60:

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

input:

7
4 4 3 1 1 1 1
3
1 4 6

output:

6
1 1 
1 2 
1 1 
4 2 3 1 4 
4 2 3 1 5 
4 2 3 6 7 

result:

ok good!

Test #61:

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

input:

8
2 2 2 2 2 2 2 1
6
1 2 3 4 6 7

output:

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

result:

ok good!

Test #62:

score: 0
Accepted
time: 23ms
memory: 884004kb

input:

8
3 3 3 2 1 1 1 1
4
4 6 7 8

output:

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

result:

ok good!

Test #63:

score: 0
Accepted
time: 32ms
memory: 884020kb

input:

8
4 3 3 1 1 1 1 1
4
1 6 7 8

output:

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

result:

ok good!

Test #64:

score: 0
Accepted
time: 32ms
memory: 884080kb

input:

9
4 3 2 1 1 1 1 1 1
4
3 4 5 7

output:

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

result:

ok good!

Test #65:

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

input:

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

output:

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

result:

ok good!

Test #66:

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

input:

14
2 1 1 1 1 1 1 1 1 1 1 1 1 1
14
1 2 3 4 5 6 7 8 9 10 11 12 13 14

output:

2
1 1 
14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 

result:

ok good!

Test #67:

score: 0
Accepted
time: 28ms
memory: 884080kb

input:

4
2 2 2 1
2
1 4

output:

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

result:

ok good!

Subtask #4:

score: 45
Accepted

Dependency #1:

100%
Accepted

Dependency #3:

100%
Accepted

Test #68:

score: 45
Accepted
time: 20ms
memory: 883948kb

input:

150
24 12 11 10 9 9 9 9 9 8 8 7 7 7 7 7 6 6 6 6 6 6 6 5 5 5 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 4 4 4 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 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 1 1 1 1 1 1 1 1 1 1 1 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:

25
18 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 
18 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 19 20 
18 1 2 3 4 5 6 7 8 9 10 11 21 22 23 12 13 14 15 
18 1 2 3 4 5 6 7 8 9 10 11 16 17 18 19 20 21 22 
18 1 2 3 4 5 6 7 8 9 23 24 25 26 27 28 29 30 31 
18 1 2 3 4 32 33 34 35 36 5 6 7 8 9 10 11 12 13 
18 ...

result:

ok good!

Test #69:

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

input:

200
9 9 9 8 8 8 7 7 6 6 6 6 6 6 6 6 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 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 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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

10
1 1 
9 2 3 1 4 5 6 7 8 9 
9 2 3 1 4 5 6 7 8 10 
9 2 3 1 4 5 6 11 12 13 
9 2 3 14 15 16 1 4 5 6 
78 2 3 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 4 5 6 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 ...

result:

ok good!

Test #70:

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

input:

250
8 7 7 7 7 6 6 6 6 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 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 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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

9
1 1 
1 1 
33 2 3 4 5 1 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 
33 2 3 4 5 1 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 
33 2 3 4 5 1 6 7 8 9 10 11 12 13 14 15 16 17 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 
33 2 3...

result:

ok good!

Test #71:

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

input:

300
8 6 6 5 5 5 5 4 4 4 4 4 4 4 4 4 4 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 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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

9
22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 
23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 23 24 25 26 27 28 
23 1 2 3 4 5 6 7 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 
23 1 2 3 45 46 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 
23 1 2 3 22 23 24 25 26 27 28 29 30 31 32 3...

result:

ok good!

Test #72:

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

input:

300
5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 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 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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

6
6 1 2 3 4 5 6 
6 7 1 2 3 4 5 
63 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 
63 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 18 19 20 21 22 23 24 25 26 27 28 29 30 ...

result:

ok good!

Test #73:

score: 0
Accepted
time: 39ms
memory: 883872kb

input:

350
5 5 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

6
2 1 2 
2 1 2 
53 3 4 5 6 7 8 9 10 11 1 2 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 
53 3 4 5 6 7 8 9 10 11 1 2 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 7...

result:

ok good!

Test #74:

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

input:

70
51 39 26 24 21 18 16 15 15 12 11 10 10 9 9 9 8 8 7 7 7 7 7 7 6 6 6 6 6 6 6 5 5 5 5 5 5 5 4 4 4 4 4 4 3 3 3 3 3 3 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1
14
1 14 15 17 26 27 34 35 41 44 48 58 62 65

output:

56
1 1 
1 1 
1 1 
1 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 2 
1 1 
1 2 
1 1 
1 2 
14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 
14 1 2 3 4 5 6 7 8 9 10 11 12 13 15 
14 1 2 3 4 5 6 7 8 9 10 11 16 12 13 
14 1 2 3 4 5 6 7 8 9 10 11 14 15 16 
14 1 2 3 4 5 6 7 8 9 10 17 18 11 12 
14...

result:

ok good!

Test #75:

score: 0
Accepted
time: 51ms
memory: 883860kb

input:

70
22 22 20 19 18 15 14 13 13 13 12 12 12 12 12 12 11 11 10 9 9 9 9 9 9 9 8 8 8 8 8 7 6 6 6 6 6 5 5 5 5 5 5 5 4 4 3 3 3 3 3 3 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
9
1 3 7 9 16 17 62 68 69

output:

24
16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 
16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 
16 1 2 3 4 5 6 7 8 9 10 17 18 11 12 13 14 
16 1 2 3 4 5 6 7 8 9 10 15 16 17 18 19 11 
17 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 
17 1 2 3 4 5 6 7 19 20 21 22 23 24 25 26 8 9 
17 1 2 3 4 5 6 7 10 11 12 13 14 1...

result:

ok good!

Test #76:

score: 0
Accepted
time: 39ms
memory: 883860kb

input:

40
61 55 33 31 28 26 26 23 21 20 18 15 13 11 11 10 9 9 8 8 7 7 7 6 4 4 4 4 3 3 2 2 2 2 2 1 1 1 1 1
9
1 12 18 20 24 29 30 32 40

output:

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

result:

ok good!

Test #77:

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

input:

127
64 32 32 16 16 16 16 8 8 8 8 8 8 8 8 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
7
1 2 4 8 16 32 64

output:

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

result:

ok good!

Test #78:

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

input:

10
31 67 31 15 21 37 53 96 81 68
4
1 2 8 10

output:

115
2 8 9 
2 8 9 
2 8 9 
2 8 9 
2 8 9 
2 8 9 
2 8 9 
2 8 9 
2 8 9 
2 8 9 
2 8 9 
2 8 9 
2 8 9 
2 8 9 
2 8 10 
2 8 2 
2 8 9 
2 8 10 
2 8 2 
2 8 9 
2 8 10 
2 8 2 
2 8 9 
2 8 10 
2 8 2 
2 8 9 
2 8 10 
2 8 2 
2 8 9 
2 8 10 
2 8 2 
2 8 9 
2 8 10 
2 8 2 
2 8 9 
2 8 10 
2 2 8 
2 9 10 
2 2 8 
2 9 10 
2 2 8 ...

result:

ok good!

Test #79:

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

input:

40
24 20 23 12 7 11 20 16 1 4 2 21 12 13 7 17 5 15 4 24 17 8 13 8 15 9 16 21 12 7 3 16 6 5 21 8 11 12 11 23
5
8 12 13 27 29

output:

24
8 1 20 3 40 12 28 35 2 
8 1 20 3 40 7 12 28 35 
8 1 20 3 40 2 7 12 28 
8 1 20 3 40 35 2 7 12 
8 1 20 3 40 28 35 2 7 
8 1 20 3 40 12 16 21 28 
8 1 20 3 35 40 2 7 8 
8 1 20 3 12 16 21 27 28 
13 1 20 32 35 40 2 3 7 8 12 16 18 21 
27 1 20 25 27 28 32 35 40 2 3 7 8 12 16 18 21 14 23 4 13 29 38 6 37 39...

result:

ok good!

Test #80:

score: 0
Accepted
time: 27ms
memory: 883740kb

input:

40
2 18 20 17 18 15 12 4 6 12 13 20 2 15 22 20 21 8 8 1 3 9 22 16 5 8 12 11 8 16 4 19 14 13 13 16 24 21 1 11
14
1 4 5 8 10 13 14 21 23 24 32 33 34 36

output:

24
1 37 
1 37 
4 15 23 37 17 
4 15 23 37 38 
8 3 12 15 16 17 23 37 38 
10 3 12 15 16 17 23 32 37 38 2 
10 3 5 12 15 16 17 23 32 37 38 
13 2 3 4 5 12 15 16 17 23 32 37 38 24 
14 2 3 4 5 12 15 16 17 23 30 32 36 37 38 
21 2 3 4 5 6 12 14 15 16 17 23 24 30 32 36 37 38 33 11 34 35 
21 2 3 4 5 6 12 14 15 ...

result:

ok good!

Test #81:

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

input:

130
5 1 7 5 7 6 4 2 4 2 7 1 5 1 1 7 4 3 3 4 3 5 1 5 5 2 1 6 5 2 7 2 1 2 3 1 1 6 1 5 3 2 1 5 7 6 5 2 5 3 5 4 2 3 1 3 2 4 6 6 1 3 4 7 6 2 7 1 7 7 5 7 2 3 1 2 2 4 4 1 3 4 7 3 7 3 6 1 1 3 3 6 5 7 4 1 4 5 3 3 5 4 4 6 1 3 2 6 4 7 3 4 2 6 1 2 7 7 7 6 5 6 7 5 2 2 2 2 7 2
7
26 43 55 69 82 116 125

output:

7
26 3 5 11 16 31 45 64 67 69 70 72 83 85 94 110 117 118 119 123 129 6 28 38 46 59 60 
43 3 5 11 16 31 45 64 65 67 69 70 72 83 85 87 92 94 104 108 110 114 117 118 119 120 122 123 129 1 4 6 13 22 24 25 28 29 38 40 44 46 47 49 
69 3 5 11 16 31 45 51 59 60 64 65 67 69 70 71 72 83 85 87 92 93 94 98 101 ...

result:

ok good!

Test #82:

score: 0
Accepted
time: 23ms
memory: 883912kb

input:

130
5 4 7 2 1 6 4 3 4 4 4 3 7 4 5 1 2 1 6 1 7 4 6 4 2 4 2 7 1 3 1 7 1 3 1 2 6 4 7 3 6 5 3 2 6 3 1 7 2 1 1 6 7 6 1 3 4 5 7 1 3 1 5 7 6 3 4 6 1 5 1 5 5 6 3 1 7 6 7 2 5 6 4 7 3 7 4 2 5 2 6 4 1 2 4 1 7 4 4 6 2 5 5 3 4 6 1 2 3 2 2 3 6 1 7 4 1 2 5 4 3 5 5 3 5 2 2 3 5 5
45
1 4 5 6 15 18 20 23 28 31 32 33 3...

output:

7
18 3 13 21 28 32 39 48 53 59 64 77 79 84 86 97 115 6 19 
31 3 13 21 23 28 32 37 39 41 45 48 52 53 54 59 64 65 68 74 77 78 79 82 84 86 91 97 100 106 113 115 
66 1 3 6 13 15 19 21 23 28 32 37 39 41 42 45 48 52 53 54 58 59 63 64 65 68 70 72 73 74 77 78 79 81 82 84 86 89 91 97 100 102 103 106 113 115 ...

result:

ok good!

Test #83:

score: 0
Accepted
time: 27ms
memory: 884108kb

input:

130
2 6 1 6 1 4 5 4 3 4 4 7 6 3 6 1 2 7 4 5 1 5 4 2 6 3 6 3 1 1 2 7 2 5 6 1 5 1 6 3 7 4 4 6 6 1 7 1 1 3 2 7 3 6 1 7 2 5 5 1 5 1 1 4 6 2 4 5 1 2 6 2 1 6 4 2 6 4 5 6 5 4 1 5 6 6 1 2 1 6 2 1 6 1 2 6 4 3 1 4 6 3 7 7 7 3 3 5 1 6 2 7 6 6 6 2 4 3 3 7 4 6 3 7 3 2 3 4 1 3
9
2 3 4 6 8 9 10 16 17

output:

30
8 12 18 32 41 47 52 56 103 
16 104 105 112 120 124 2 4 12 13 15 18 25 27 32 35 39 
17 41 44 45 47 52 54 56 65 71 74 77 80 85 86 90 93 96 
17 101 103 104 105 110 112 113 114 115 120 122 124 2 4 7 12 13 
17 15 18 20 22 25 27 32 34 35 37 39 41 44 45 47 52 54 
17 56 58 59 61 65 68 71 74 77 79 80 81 8...

result:

ok good!

Test #84:

score: 0
Accepted
time: 43ms
memory: 884284kb

input:

70
8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7 7 7 7 6 6 6 6 6 6 6 6 6 5 5 5 5 5 5 5 5 5 5 5 5
20
1 2 3 4 6 7 8 9 10 13 21 24 30 31 33 40 45 46 54 70

output:

9
4 1 2 3 4 
46 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 1 2 3 4 44 45 46 
46 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 47 48 49 1 2 3 4 
54 5 6 7 8 9 10 11 12...

result:

ok good!

Test #85:

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

input:

90
8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7 7 6 6 6 6 6 6 6 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2
20
1 2 3 6 7 8 9 10 13 20 24 30 32 46 53 63 68 69 70 79

output:

8
46 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 
46 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 47 48 
46 1 2 3 4 5 6 7 8 9 10 11 12 13...

result:

ok good!

Test #86:

score: 0
Accepted
time: 23ms
memory: 884052kb

input:

120
8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 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 1 1 1 1 1 1 1 1
20
1 2 3 4 5 9 10 14 15 19 25 28 30 33 36 77 78 99 108 116

output:

9
1 1 
30 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 28 29 30 
36 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 31 1 28 29 30 32 33 34 35 36 
36 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 31 37 1 28 29 30 32 33 34 35 
36...

result:

ok good!

Test #87:

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

input:

200
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 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 1 1 1 1 1 1 1 1 1 ...

output:

5
8 1 2 3 4 5 6 7 8 
123 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 1 2 3 4 5 6 7 8 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95...

result:

ok good!

Test #88:

score: 0
Accepted
time: 32ms
memory: 883880kb

input:

250
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 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 1 1 1 1 1 1 1 1 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:

4
59 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 
147 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44...

result:

ok good!

Test #89:

score: 0
Accepted
time: 32ms
memory: 884108kb

input:

300
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

5
3 1 2 3 
51 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 1 2 3 47 48 49 50 51 
61 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 52 53 54 55 56 ...

result:

ok good!

Test #90:

score: 0
Accepted
time: 32ms
memory: 883868kb

input:

100
9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
49
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 76 77 78 79 80 81 82 83 84 85 ...

output:

18
16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 
24 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 
24 41 42 43 44 45 46 47 48 49 50 1 2 3 4 5 6 7 8 9 10 11 12 13 14 
24 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 
24 39 40 41 42 43 44 45 46 47 48 49...

result:

ok good!

Test #91:

score: 0
Accepted
time: 27ms
memory: 883856kb

input:

446
55 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

55
9 1 2 3 4 5 6 7 8 9 
9 1 10 11 12 13 14 15 16 17 
9 1 18 19 20 21 22 23 24 25 
9 1 26 27 28 29 30 31 32 33 
9 1 34 35 36 37 38 39 40 41 
9 1 42 43 44 45 46 47 48 49 
9 1 50 51 52 53 54 55 56 57 
9 1 58 59 60 61 62 63 64 65 
9 1 66 67 68 69 70 71 72 73 
9 1 74 75 76 77 78 79 80 81 
9 1 82 83 84 85...

result:

ok good!

Test #92:

score: 0
Accepted
time: 24ms
memory: 883896kb

input:

470
31 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

31
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
470 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51...

result:

ok good!

Test #93:

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

input:

31
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
15
1 2 3 4 5 6 7 24 25 26 27 28 29 30 31

output:

35
3 1 2 3 
7 1 2 3 4 5 6 7 
7 1 2 3 4 5 6 7 
7 1 2 3 4 5 6 8 
7 1 2 3 4 5 6 7 
7 1 2 3 4 5 8 9 
7 1 2 3 4 5 6 7 
7 1 2 3 4 8 9 10 
7 1 2 3 4 5 6 7 
7 1 2 8 9 10 11 3 
7 1 2 4 5 6 7 8 
7 1 9 10 11 12 2 3 
7 1 4 5 6 7 8 9 
7 10 11 12 13 1 2 3 
7 4 5 6 7 8 9 10 
7 11 12 13 14 1 2 3 
7 4 5 6 7 8 9 10 
...

result:

ok good!

Test #94:

score: 0
Accepted
time: 43ms
memory: 883864kb

input:

100
1 14 14 8 2 2 5 16 7 1 4 7 7 2 7 2 1 1 4 5 2 14 9 3 7 1 11 4 7 4 2 8 17 1 7 1 7 2 11 3 3 2 1 7 1 9 1 7 3 3 4 2 1 10 1 1 1 3 8 7 1 1 1 2 4 1 3 16 5 9 3 3 1 3 2 3 7 11 1 3 1 11 13 4 1 3 1 17 1 2 1 16 11 4 9 5 6 4 1 2
7
1 2 4 8 16 32 64

output:

18
1 33 
2 88 8 
8 33 68 88 92 8 2 3 22 
8 33 68 88 92 8 2 3 22 
8 33 68 88 92 8 83 2 3 
8 33 68 88 92 8 22 83 2 
16 33 68 88 92 3 8 22 27 39 78 82 83 93 2 54 23 
16 33 68 88 92 3 8 22 27 39 78 82 83 93 2 46 54 
16 33 68 88 92 3 8 22 27 39 70 78 82 83 93 95 2 
16 33 68 88 92 3 4 8 22 23 27 32 39 46 ...

result:

ok good!

Test #95:

score: 0
Accepted
time: 23ms
memory: 884048kb

input:

350
3 1 1 2 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 2 3 1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 2 1 1 2 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 2 2 1 1 1 1 1 1 3 1 1 1 1 2 1 1 1 1 2 2 1 1 1 2 2 1 2 1 1 1 2 2 1 1 5 1 1 2 1 3 1 1 1 1 1 1 2 1 3 1 1 1 2 1 1 1 1 1 1 2 1 1 1 2 1 1 1 1 1 1 1 1 1 1 3 2 1 1 3 1 ...

output:

7
1 206 
2 308 103 
16 206 247 308 103 233 298 327 332 344 1 32 77 108 117 143 147 
32 206 247 308 103 221 224 233 250 253 254 259 261 276 280 285 291 298 305 320 321 322 327 332 344 1 4 6 7 24 31 32 36 
64 206 247 308 37 48 51 52 55 67 69 70 77 82 87 88 92 93 95 99 100 103 106 108 115 117 121 128 1...

result:

ok good!

Subtask #5:

score: 15
Accepted

Dependency #4:

100%
Accepted

Test #96:

score: 15
Accepted
time: 32ms
memory: 884128kb

input:

27
12 148 141 10 98 1 82 103 145 60 190 102 181 147 152 185 24 134 179 127 141 38 169 93 132 157 49
6
1 5 7 13 17 26

output:

190
1 11 
1 11 
1 11 
1 11 
1 11 
5 11 16 13 19 23 
5 11 16 13 19 23 
5 11 16 13 19 23 
5 11 16 13 19 23 
5 11 16 13 19 23 
5 11 16 13 19 23 
5 11 16 13 19 23 
5 11 16 13 19 23 
5 11 16 13 19 23 
5 11 16 13 19 23 
5 11 16 13 19 23 
5 11 16 13 19 23 
5 11 16 13 19 23 
5 11 16 13 19 26 
5 11 16 13 19 ...

result:

ok good!

Test #97:

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

input:

160
35 20 9 34 11 22 2 17 18 37 32 27 4 22 26 15 32 19 22 29 8 30 7 10 23 33 11 18 24 18 29 34 17 35 26 12 28 6 27 19 37 34 8 7 33 32 18 13 24 13 26 34 6 3 37 9 10 6 16 34 19 8 30 8 14 14 32 3 35 18 12 20 1 19 25 30 19 6 2 16 15 24 34 6 31 7 22 29 11 14 14 23 7 25 32 14 9 11 21 31 37 31 2 19 31 4 13...

output:

37
8 10 41 55 101 122 1 34 69 
8 10 41 55 101 122 110 1 4 
8 10 41 55 101 122 32 34 42 
20 10 41 52 55 60 69 83 101 110 122 151 1 4 26 32 34 42 45 11 17 
20 10 41 52 55 60 69 83 101 110 122 151 1 4 26 32 34 42 45 46 67 
20 10 41 52 55 60 69 83 95 101 110 122 151 1 4 11 17 26 32 34 42 
22 10 41 45 46...

result:

ok good!

Test #98:

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

input:

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

output:

9
101 16 43 51 89 91 111 112 133 138 140 143 147 152 157 158 159 166 169 178 188 189 192 194 211 214 233 255 259 262 267 273 283 290 294 322 323 326 327 330 332 348 353 380 385 390 391 395 396 397 414 416 419 424 429 453 457 462 463 469 480 484 492 501 511 521 528 551 560 562 568 569 571 575 587 9 1...

result:

ok good!

Test #99:

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

input:

400
15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 14 14 14 14 14 13 13 13 13 13 13 13 12 12 12 12 12 12...

output:

15
86 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 
86 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17...

result:

ok good!

Test #100:

score: 0
Accepted
time: 23ms
memory: 883960kb

input:

750
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 ...

output:

8
45 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 
162 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...

result:

ok good!

Test #101:

score: 0
Accepted
time: 43ms
memory: 884016kb

input:

460
13 13 13 13 13 13 13 13 13 13 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12...

output:

24
32 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 
114 1 2 3 4 5 6 7 8 9 10 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 9...

result:

ok good!

Test #102:

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

input:

2751
250 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

250
12 1 2 3 4 5 6 7 8 9 10 11 12 
12 1 13 14 15 16 17 18 19 20 21 22 23 
12 1 24 25 26 27 28 29 30 31 32 33 34 
12 1 35 36 37 38 39 40 41 42 43 44 45 
12 1 46 47 48 49 50 51 52 53 54 55 56 
12 1 57 58 59 60 61 62 63 64 65 66 67 
12 1 68 69 70 71 72 73 74 75 76 77 78 
12 1 79 80 81 82 83 84 85 86 87...

result:

ok good!

Test #103:

score: 0
Accepted
time: 69ms
memory: 884500kb

input:

2924
77 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

77
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 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 good!

Test #104:

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

input:

76
76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
39
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 57 58 59 60 61 62 63 64 65 ...

output:

76
19 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 
19 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 
19 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 20 
19 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 
19 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 20 21 
19 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1...

result:

ok good!

Test #105:

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

input:

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

output:

11
1 1279 
2 558 1279 
4 558 1279 718 808 
16 558 1279 1429 1483 120 163 214 291 713 718 774 808 920 1044 1294 1316 
32 558 1279 1429 1483 87 120 163 214 242 256 291 316 323 383 453 460 493 509 649 700 713 718 743 764 768 772 774 808 920 940 1028 1044 
64 558 1062 1112 1203 1264 1279 1294 1316 1319 ...

result:

ok good!

Test #106:

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

input:

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

output:

9
1 1267 
2 225 1267 
4 1335 1336 46 146 
16 225 242 316 366 435 835 853 855 915 1095 1104 1267 1271 1302 1313 1335 
32 1336 1426 1427 2052 37 46 54 62 63 88 95 100 103 132 139 146 148 169 171 195 225 232 242 316 320 322 366 368 420 435 461 482 
128 488 508 522 526 534 581 608 611 719 741 746 762 77...

result:

ok good!

Subtask #6:

score: 15
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Test #107:

score: 15
Accepted
time: 31ms
memory: 884088kb

input:

40
153 344 238 669 595 304 297 265 438 678 232 354 377 249 297 629 693 559 65 283 407 198 128 290 443 371 667 289 86 601 429 231 266 624 474 12 319 436 364 646
7
1 8 9 12 21 27 28

output:

693
1 17 
1 17 
1 17 
1 17 
1 17 
1 17 
1 17 
1 17 
1 17 
1 17 
1 17 
1 17 
1 17 
1 17 
1 17 
8 10 17 4 27 40 16 34 30 
8 10 17 4 27 40 16 34 30 
8 10 17 4 27 40 16 34 30 
8 10 17 4 27 40 16 34 30 
8 10 17 4 27 40 16 34 30 
8 10 17 4 27 40 16 34 30 
8 10 17 4 27 40 16 34 5 
8 10 17 4 27 40 16 34 30 ...

result:

ok good!

Test #108:

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

input:

420
51 4 68 8 19 9 42 34 39 31 62 47 46 32 55 42 31 28 37 21 36 44 8 13 56 30 15 4 23 17 56 42 38 25 26 5 39 16 38 46 55 26 23 34 27 36 60 55 35 38 69 31 49 21 28 42 27 21 57 12 47 52 56 10 32 6 33 64 20 44 15 50 45 25 53 30 59 43 47 43 45 36 62 57 16 7 20 17 49 11 18 42 28 24 48 13 45 40 28 19 6 38...

output:

70
18 130 170 243 291 296 324 343 51 116 131 210 3 150 176 238 305 347 355 
18 130 170 243 291 296 324 343 51 116 131 210 414 3 120 150 156 176 238 
18 130 170 243 291 296 324 343 51 116 131 210 282 305 347 355 414 3 120 
18 130 170 243 291 296 324 343 51 116 131 150 156 176 210 238 282 305 309 
18 ...

result:

ok good!

Test #109:

score: 0
Accepted
time: 48ms
memory: 884264kb

input:

3500
4 4 7 4 7 1 6 6 7 1 1 6 1 4 3 2 4 1 5 3 8 1 4 1 3 6 2 7 7 2 3 2 8 2 3 4 1 2 2 4 6 8 1 2 8 7 7 4 4 1 3 5 1 6 7 2 3 4 3 1 7 8 1 6 7 4 5 1 2 2 7 6 5 1 3 1 4 5 5 8 5 6 5 6 1 7 2 1 1 6 3 1 1 2 7 6 8 7 1 7 4 6 8 2 4 5 3 1 6 1 8 4 4 5 3 2 2 2 3 3 2 2 4 2 8 3 6 7 3 2 1 1 2 7 3 5 8 5 1 1 4 6 5 7 1 2 2 2...

output:

8
686 21 33 42 45 62 80 97 103 111 125 137 155 159 200 215 219 223 231 243 253 255 283 284 307 312 314 322 326 330 340 347 351 361 381 392 409 411 412 417 432 436 442 449 455 456 460 465 477 478 482 483 484 485 492 495 515 521 522 524 538 540 579 607 627 652 661 675 689 726 758 770 787 795 836 838 8...

result:

ok good!

Test #110:

score: 0
Accepted
time: 39ms
memory: 884356kb

input:

700
70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 69 68 67 66 65 64 64 63 62 61 60 59 59 58 57 56 56 55 54 54 53 52 52 51 51 50 49 49 48 48 47 47 46 46 45...

output:

103
1 1 
6 2 3 4 5 6 7 
9 8 9 10 11 12 13 14 15 16 
60 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 1 2 3 4 5 6 7 8 9 10 11 12 
60 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 3...

result:

ok good!

Test #111:

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

input:

6250
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5...

output:

6
291 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 10...

result:

ok good!

Test #112:

score: 0
Accepted
time: 107ms
memory: 884400kb

input:

2000
14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 1...

output:

28
26 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 
499 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 1...

result:

ok good!

Test #113:

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

input:

13930
1071 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

1071
14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 
14 1 15 16 17 18 19 20 21 22 23 24 25 26 27 
14 1 28 29 30 31 32 33 34 35 36 37 38 39 40 
14 1 41 42 43 44 45 46 47 48 49 50 51 52 53 
14 1 54 55 56 57 58 59 60 61 62 63 64 65 66 
14 1 67 68 69 70 71 72 73 74 75 76 77 78 79 
14 1 80 81 82 83 84 85 86 87 88 8...

result:

ok good!

Test #114:

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

input:

14828
173 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

173
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 1 
1 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 good!

Test #115:

score: 0
Accepted
time: 51ms
memory: 884160kb

input:

172
172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 9...

output:

172
43 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 
43 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 
43 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ...

result:

ok good!

Test #116:

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

input:

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

output:

22
1 1224 
2 2438 1224 
2 2438 1224 
2 2438 1092 
8 1224 2178 2438 1092 1723 1989 2110 783 
8 1224 2178 2438 1092 1623 1723 1989 2110 
16 1224 2178 2388 2438 4303 4477 4908 99 783 1092 1395 1623 1723 1989 2074 2110 
16 1224 2178 2352 2388 2438 3364 4135 4303 4400 4477 4908 99 783 1065 1092 1395 
32 ...

result:

ok good!

Test #117:

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

input:

11000
1 2 1 1 1 1 1 2 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 2 2 2 1 1 3 1 3 1 1 2 2 1 1 1 1 2 1 2 1 1 1 2 1 1 1 1 4 1 1 1 3 2 1 2 1 1 3 1 1 1 1 1 1 1 1 1 1 1 3 2 1 2 2 1 1 2 2 2 2 1 1 1 1 1 2 4 1 2 1 1 1 2 1 1 1 1 1 1 3 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 2 2 ...

output:

9
1 9052 
2 478 554 
4 726 1326 1427 1489 
16 2700 3901 4683 7060 9052 9592 9653 10348 10604 10648 478 554 630 726 789 954 
128 1326 1427 1489 1499 1520 1641 1654 1834 1868 2094 2319 2333 2700 3416 3437 3901 4348 4418 4488 4508 4683 4815 5111 5342 5356 5397 5481 5801 5913 6025 6095 6400 7037 7060 71...

result:

ok good!

Extra Test:

score: 0
Extra Test Passed