QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#403375#6301. Minimum Suffixjxy2012RE 18ms4324kbC++239.9kb2024-05-02 09:44:402024-05-02 09:44:41

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3796kb

input:

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

output:

1 2 2 
-1
1 2 1 
1 1 2 
2 1 2 
1 1 1 

result:

ok 16 numbers

Test #2:

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

input:

2
2
1 1
2
1 2

output:

1 2 
1 1 

result:

ok 4 number(s): "1 2 1 1"

Test #3:

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

input:

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

output:

1 2 2 2 
-1
-1
1 2 2 1 
-1
-1
-1
-1
1 2 1 3 
-1
1 2 1 2 
1 2 1 1 
1 1 2 2 
-1
-1
1 1 2 1 
-1
2 1 2 2 
-1
2 1 2 1 
1 1 1 2 
2 1 1 2 
2 2 1 2 
1 1 1 1 

result:

ok 63 numbers

Test #4:

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

input:

120
5
1 1 1 1 1
5
1 1 1 1 2
5
1 1 1 1 3
5
1 1 1 1 4
5
1 1 1 1 5
5
1 1 1 2 1
5
1 1 1 2 2
5
1 1 1 2 3
5
1 1 1 2 4
5
1 1 1 2 5
5
1 1 1 3 1
5
1 1 1 3 2
5
1 1 1 3 3
5
1 1 1 3 4
5
1 1 1 3 5
5
1 1 1 4 1
5
1 1 1 4 2
5
1 1 1 4 3
5
1 1 1 4 4
5
1 1 1 4 5
5
1 1 2 1 1
5
1 1 2 1 2
5
1 1 2 1 3
5
1 1 2 1 4
5
1 1 2 ...

output:

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

result:

ok 256 numbers

Test #5:

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

input:

720
6
1 1 1 1 1 1
6
1 1 1 1 1 2
6
1 1 1 1 1 3
6
1 1 1 1 1 4
6
1 1 1 1 1 5
6
1 1 1 1 1 6
6
1 1 1 1 2 1
6
1 1 1 1 2 2
6
1 1 1 1 2 3
6
1 1 1 1 2 4
6
1 1 1 1 2 5
6
1 1 1 1 2 6
6
1 1 1 1 3 1
6
1 1 1 1 3 2
6
1 1 1 1 3 3
6
1 1 1 1 3 4
6
1 1 1 1 3 5
6
1 1 1 1 3 6
6
1 1 1 1 4 1
6
1 1 1 1 4 2
6
1 1 1 1 4 3
6
...

output:

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

result:

ok 1165 numbers

Test #6:

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

input:

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

output:

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

result:

ok 6438 numbers

Test #7:

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

input:

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

output:

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

result:

ok 44590 numbers

Test #8:

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

input:

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

output:

1 1 1 1 1 1 1 1 1 
2 2 2 2 2 2 2 1 2 
2 2 2 2 2 2 1 1 2 
2 2 2 2 2 1 1 1 2 
2 2 2 2 1 1 1 1 2 
2 2 2 1 1 1 1 1 2 
2 2 1 1 1 1 1 1 2 
2 1 1 1 1 1 1 1 2 
1 1 1 1 1 1 1 1 2 
2 2 2 2 2 2 1 2 1 
2 2 2 2 2 2 1 2 2 
-1
-1
-1
-1
-1
-1
2 2 2 2 2 1 1 2 1 
2 2 2 2 2 1 1 2 2 
-1
-1
-1
-1
-1
2 2 2 2 1 1 1 2 1 
2...

result:

ok 17638 numbers

Test #9:

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

input:

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

output:

1 1 1 1 1 1 1 1 1 1 
2 2 2 2 2 2 2 2 1 2 
2 2 2 2 2 2 2 1 1 2 
2 2 2 2 2 2 1 1 1 2 
2 2 2 2 2 1 1 1 1 2 
2 2 2 2 1 1 1 1 1 2 
2 2 2 1 1 1 1 1 1 2 
2 2 1 1 1 1 1 1 1 2 
2 1 1 1 1 1 1 1 1 2 
1 1 1 1 1 1 1 1 1 2 
2 2 2 2 2 2 2 1 2 1 
2 2 2 2 2 2 2 1 2 2 
-1
-1
-1
-1
-1
-1
-1
2 2 2 2 2 2 1 1 2 1 
2 2 2 ...

result:

ok 54425 numbers

Test #10:

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

input:

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

output:

1 1 1 1 1 1 1 1 1 1 1 
2 2 2 2 2 2 2 2 2 1 2 
2 2 2 2 2 2 2 2 1 1 2 
2 2 2 2 2 2 2 1 1 1 2 
2 2 2 2 2 2 1 1 1 1 2 
2 2 2 2 2 1 1 1 1 1 2 
2 2 2 2 1 1 1 1 1 1 2 
2 2 2 1 1 1 1 1 1 1 2 
2 2 1 1 1 1 1 1 1 1 2 
2 1 1 1 1 1 1 1 1 1 2 
1 1 1 1 1 1 1 1 1 1 2 
2 2 2 2 2 2 2 2 1 2 1 
2 2 2 2 2 2 2 2 1 2 2 
-...

result:

ok 168246 numbers

Test #11:

score: 0
Accepted
time: 7ms
memory: 4304kb

input:

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

output:

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

result:

ok 211133 numbers

Test #12:

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

input:

100000
12
1 2 2 4 5 5 2 8 1 1 11 11
12
1 2 2 4 5 5 2 8 1 1 11 1
12
1 2 2 4 5 5 2 8 1 1 1 12
12
1 2 2 4 5 5 2 8 1 1 1 1
12
1 2 2 4 5 5 2 2 9 10 11 12
12
1 2 2 4 5 5 2 2 9 10 11 11
12
1 2 2 4 5 5 2 2 9 10 11 10
12
1 2 2 4 5 5 2 2 9 10 11 9
12
1 2 2 4 5 5 2 2 9 10 11 2
12
1 2 2 4 5 5 2 2 9 10 11 1
12
1...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 272700 numbers

Test #13:

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

input:

8012
12
1 1 1 4 4 6 4 8 4 4 11 4
12
1 1 1 4 4 6 4 8 4 4 11 1
12
1 1 1 4 4 6 4 8 4 4 4 12
12
1 1 1 4 4 6 4 8 4 4 4 4
12
1 1 1 4 4 6 4 8 4 4 4 1
12
1 1 1 4 4 6 4 8 4 4 1 12
12
1 1 1 4 4 6 4 8 4 4 1 1
12
1 1 1 4 4 6 4 8 4 1 11 12
12
1 1 1 4 4 6 4 8 4 1 11 11
12
1 1 1 4 4 6 4 8 4 1 11 1
12
1 1 1 4 4 6 4...

output:

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

result:

ok 39406 numbers

Test #14:

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

input:

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

output:

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

result:

ok 173800 numbers

Test #15:

score: 0
Accepted
time: 7ms
memory: 4244kb

input:

100000
13
1 2 3 4 4 6 6 6 9 9 11 3 1
13
1 2 3 4 4 6 6 6 9 9 11 2 13
13
1 2 3 4 4 6 6 6 9 9 11 2 2
13
1 2 3 4 4 6 6 6 9 9 11 2 1
13
1 2 3 4 4 6 6 6 9 9 11 1 13
13
1 2 3 4 4 6 6 6 9 9 11 1 1
13
1 2 3 4 4 6 6 6 9 9 9 12 13
13
1 2 3 4 4 6 6 6 9 9 9 12 12
13
1 2 3 4 4 6 6 6 9 9 9 12 9
13
1 2 3 4 4 6 6 6 ...

output:

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

result:

ok 181240 numbers

Test #16:

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

input:

100000
13
1 2 3 3 5 6 2 8 2 1 11 1 1
13
1 2 3 3 5 6 2 8 2 1 1 12 13
13
1 2 3 3 5 6 2 8 2 1 1 12 12
13
1 2 3 3 5 6 2 8 2 1 1 12 1
13
1 2 3 3 5 6 2 8 2 1 1 1 13
13
1 2 3 3 5 6 2 8 2 1 1 1 1
13
1 2 3 3 5 6 2 8 1 10 11 12 13
13
1 2 3 3 5 6 2 8 1 10 11 12 12
13
1 2 3 3 5 6 2 8 1 10 11 12 11
13
1 2 3 3 5 ...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 181180 numbers

Test #17:

score: 0
Accepted
time: 7ms
memory: 4192kb

input:

100000
13
1 2 3 2 2 6 1 8 9 10 1 1 13
13
1 2 3 2 2 6 1 8 9 10 1 1 1
13
1 2 3 2 2 6 1 8 9 9 11 12 13
13
1 2 3 2 2 6 1 8 9 9 11 12 12
13
1 2 3 2 2 6 1 8 9 9 11 12 11
13
1 2 3 2 2 6 1 8 9 9 11 12 9
13
1 2 3 2 2 6 1 8 9 9 11 12 8
13
1 2 3 2 2 6 1 8 9 9 11 12 1
13
1 2 3 2 2 6 1 8 9 9 11 11 13
13
1 2 3 2 ...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 219508 numbers

Test #18:

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

input:

100000
13
1 2 2 4 4 1 7 1 9 10 9 1 13
13
1 2 2 4 4 1 7 1 9 10 9 1 1
13
1 2 2 4 4 1 7 1 9 10 1 12 13
13
1 2 2 4 4 1 7 1 9 10 1 12 12
13
1 2 2 4 4 1 7 1 9 10 1 12 1
13
1 2 2 4 4 1 7 1 9 10 1 1 13
13
1 2 2 4 4 1 7 1 9 10 1 1 1
13
1 2 2 4 4 1 7 1 9 9 11 12 13
13
1 2 2 4 4 1 7 1 9 9 11 12 12
13
1 2 2 4 4...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 205408 numbers

Test #19:

score: 0
Accepted
time: 7ms
memory: 4152kb

input:

100000
13
1 2 1 4 5 1 7 8 9 9 11 7 1
13
1 2 1 4 5 1 7 8 9 9 11 1 13
13
1 2 1 4 5 1 7 8 9 9 11 1 1
13
1 2 1 4 5 1 7 8 9 9 9 12 13
13
1 2 1 4 5 1 7 8 9 9 9 12 12
13
1 2 1 4 5 1 7 8 9 9 9 12 9
13
1 2 1 4 5 1 7 8 9 9 9 12 8
13
1 2 1 4 5 1 7 8 9 9 9 12 7
13
1 2 1 4 5 1 7 8 9 9 9 12 1
13
1 2 1 4 5 1 7 8 9...

output:

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

result:

ok 254500 numbers

Test #20:

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

input:

100000
13
1 1 3 4 4 4 7 3 3 10 10 10 10
13
1 1 3 4 4 4 7 3 3 10 10 10 3
13
1 1 3 4 4 4 7 3 3 10 10 10 1
13
1 1 3 4 4 4 7 3 3 10 10 3 13
13
1 1 3 4 4 4 7 3 3 10 10 3 3
13
1 1 3 4 4 4 7 3 3 10 10 3 1
13
1 1 3 4 4 4 7 3 3 10 10 1 13
13
1 1 3 4 4 4 7 3 3 10 10 1 1
13
1 1 3 4 4 4 7 3 3 10 3 12 13
13
1 1 ...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 273136 numbers

Test #21:

score: 0
Accepted
time: 5ms
memory: 4192kb

input:

42900
13
1 1 1 4 5 5 7 7 1 1 11 12 12
13
1 1 1 4 5 5 7 7 1 1 11 12 11
13
1 1 1 4 5 5 7 7 1 1 11 12 1
13
1 1 1 4 5 5 7 7 1 1 11 11 13
13
1 1 1 4 5 5 7 7 1 1 11 11 11
13
1 1 1 4 5 5 7 7 1 1 11 11 1
13
1 1 1 4 5 5 7 7 1 1 11 1 13
13
1 1 1 4 5 5 7 7 1 1 11 1 1
13
1 1 1 4 5 5 7 7 1 1 1 12 13
13
1 1 1 4 5...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2 3 3 2 1 2 1 3 1 1 1 1 1 
3 4 4 3 2 3 2 4 2 2 2 1 2 
3 4 4 3 2 3 2 4 2 2 1 1 2 
3 4 4 3 2 3 2 4 2 1 1 1 2 
2 3 3 2 1 2 1 3 1 1 1 1 2 
-1
-1
-1
3 4 4 3 2 3 2 4 2 2 1 2 1 
3 4 4 3 2 3 2 4 2 2 1 2 2 
-1
-1
-1
-1
-1
3 4 4 3 2 3 2 4 2 1 1 2 1 
3 4 4 3 2 3 2 4 2 1 1...

result:

ok 154428 numbers

Test #22:

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

input:

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

output:

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

result:

ok 999990 numbers

Test #23:

score: 0
Accepted
time: 13ms
memory: 4148kb

input:

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

output:

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

result:

ok 999990 numbers

Test #24:

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

input:

62500
16
1 2 3 4 5 1 7 1 9 10 11 1 1 14 15 16
16
1 2 2 4 4 2 7 7 2 2 11 11 2 14 15 16
16
1 2 2 4 4 2 7 8 7 10 11 12 10 10 10 16
16
1 2 3 4 1 6 1 1 9 10 11 12 13 14 15 9
16
1 1 1 1 5 5 5 8 8 10 11 12 10 10 15 10
16
1 2 1 4 1 1 7 1 9 10 11 9 13 9 9 9
16
1 2 3 1 5 6 1 8 9 1 1 12 1 1 1 16
16
1 2 3 3 3 3...

output:

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

result:

ok 1000000 numbers

Test #25:

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

input:

62500
16
1 2 3 3 3 6 7 6 6 6 11 6 6 14 6 6
16
1 1 1 4 5 4 7 4 4 4 11 12 11 4 15 4
16
1 2 3 4 5 6 3 3 3 10 3 12 3 14 3 16
16
1 1 1 4 5 4 7 8 7 10 11 12 10 14 10 16
16
1 2 3 4 5 6 6 8 8 6 6 12 6 6 6 16
16
1 2 3 4 5 6 5 5 9 5 5 5 5 5 5 5
16
1 2 2 2 2 6 6 6 2 2 2 12 13 14 15 16
16
1 2 3 4 2 2 2 2 2 10 2...

output:

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

result:

ok 1000000 numbers

Test #26:

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

input:

58823
17
1 2 3 4 5 3 3 3 3 10 3 3 13 3 15 3 3
17
1 2 3 2 2 6 2 2 2 2 11 2 2 2 15 16 15
17
1 2 1 1 5 6 5 5 1 10 11 12 10 10 10 10 17
17
1 2 3 2 2 2 2 2 9 2 2 2 13 14 15 16 13
17
1 2 3 2 5 6 5 2 9 2 2 2 2 14 15 14 17
17
1 1 1 4 4 4 7 7 7 1 1 12 12 12 1 16 17
17
1 2 1 1 1 6 7 6 6 10 6 6 6 14 6 6 6
17
1...

output:

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

result:

ok 999991 numbers

Test #27:

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

input:

58823
17
1 2 3 4 2 2 7 2 2 10 2 2 2 14 15 2 17
17
1 2 3 3 3 3 3 8 9 10 8 12 8 8 8 8 8
17
1 2 1 1 5 6 5 5 5 5 11 5 13 5 5 5 5
17
1 2 2 4 4 2 2 2 2 2 2 12 12 14 15 16 14
17
1 2 3 4 3 6 7 8 9 6 6 12 6 6 6 6 6
17
1 1 3 4 5 5 7 7 5 10 10 12 13 12 12 12 12
17
1 2 2 4 4 2 2 2 9 10 11 9 9 9 9 16 9
17
1 2 3 ...

output:

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

result:

ok 999991 numbers

Test #28:

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

input:

58823
17
1 2 3 2 2 2 2 2 2 2 2 12 2 14 2 2 17
17
1 2 1 1 1 1 1 1 1 1 1 1 1 14 1 1 1
17
1 1 1 4 1 1 1 8 1 1 1 1 1 1 1 1 1
17
1 2 3 3 3 3 3 3 9 10 9 9 13 9 9 9 9
17
1 1 3 3 3 3 3 3 9 9 9 12 13 12 12 12 17
17
1 2 3 3 3 3 3 3 3 3 11 11 11 3 15 15 17
17
1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 16 16
17
1 2 3 3 3 3 ...

output:

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

result:

ok 999991 numbers

Test #29:

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

input:

55555
18
1 1 1 1 1 6 7 8 9 6 11 6 6 14 6 6 6 6
18
1 2 2 4 5 6 7 4 9 4 11 4 4 4 4 4 4 4
18
1 2 1 1 5 6 7 5 5 5 11 12 13 11 11 16 11 11
18
1 2 3 4 5 5 7 8 9 10 11 7 13 7 7 7 7 7
18
1 2 3 1 5 1 1 8 1 10 11 1 13 14 15 13 1 1
18
1 2 3 1 5 1 1 1 1 10 1 12 1 14 15 1 17 18
18
1 2 3 1 5 6 7 8 9 10 11 12 13 1...

output:

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

result:

ok 999990 numbers

Test #30:

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

input:

55555
18
1 1 1 4 5 4 7 8 8 8 11 8 13 14 13 13 13 13
18
1 1 3 3 5 6 5 5 5 5 5 5 5 5 15 16 17 15
18
1 1 1 4 5 6 4 8 9 10 8 12 13 8 8 8 8 8
18
1 2 3 4 2 2 7 2 2 10 11 2 2 2 15 2 17 18
18
1 2 3 2 2 2 7 8 2 10 11 10 10 2 2 2 17 18
18
1 2 3 4 5 3 7 8 9 3 11 3 3 3 3 3 17 3
18
1 2 1 4 1 1 7 1 1 1 1 1 1 14 1...

output:

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

result:

ok 999990 numbers

Test #31:

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

input:

55555
18
1 1 1 4 4 6 7 6 6 6 6 6 13 6 15 6 17 6
18
1 2 2 2 2 2 7 7 9 7 7 12 12 7 15 16 15 15
18
1 2 2 2 5 5 5 5 5 10 10 12 10 14 15 14 14 14
18
1 2 2 2 5 5 5 5 5 5 5 5 5 14 14 14 14 18
18
1 1 1 1 5 5 5 5 5 5 5 5 13 5 15 5 17 5
18
1 1 3 3 1 1 1 8 8 1 1 12 1 1 1 1 1 1
18
1 1 3 4 4 4 7 7 4 4 4 4 4 4 4 ...

output:

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

result:

ok 999990 numbers

Test #32:

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

input:

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

output:

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

result:

ok 999989 numbers

Test #33:

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

input:

52631
19
1 2 3 3 3 3 3 3 3 10 10 12 12 12 12 12 12 18 19
19
1 2 3 1 5 1 1 1 1 10 1 12 13 1 15 1 1 18 1
19
1 2 3 4 2 2 7 2 9 2 2 2 13 14 2 16 2 2 19
19
1 2 2 4 5 6 4 4 9 10 4 4 4 4 15 4 4 4 4
19
1 2 3 1 1 6 1 1 1 1 11 12 13 11 15 11 11 11 11
19
1 1 1 4 4 4 4 4 4 4 4 4 4 4 4 4 17 18 17
19
1 2 1 1 5 6 ...

output:

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

result:

ok 999989 numbers

Test #34:

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

input:

52631
19
1 2 3 4 2 6 2 2 2 10 11 2 2 2 2 2 2 2 2
19
1 2 2 2 2 6 6 8 8 8 8 8 13 8 8 8 8 8 8
19
1 1 1 1 1 6 6 6 1 10 10 10 10 14 15 14 14 14 14
19
1 2 2 2 2 2 2 2 9 9 9 12 13 12 15 12 12 12 12
19
1 1 1 1 1 1 7 8 7 7 7 7 13 7 7 16 7 7 19
19
1 1 1 1 5 5 7 7 9 10 9 9 9 9 9 9 9 9 19
19
1 1 1 1 1 1 1 1 1 1...

output:

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

result:

ok 999989 numbers

Test #35:

score: 0
Accepted
time: 18ms
memory: 4188kb

input:

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

output:

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

result:

ok 1000000 numbers

Test #36:

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

input:

50000
20
1 2 3 4 5 3 3 3 3 3 11 12 3 3 3 3 3 3 3 3
20
1 2 3 3 5 5 7 8 7 10 7 7 7 14 15 14 7 7 7 20
20
1 2 1 1 5 6 5 8 5 10 5 5 5 5 5 5 5 18 19 5
20
1 2 3 2 5 2 7 8 7 10 11 7 7 14 7 7 7 7 19 7
20
1 2 2 2 2 2 7 7 9 9 7 7 7 7 15 7 7 7 7 7
20
1 2 3 4 5 2 2 2 2 2 2 12 2 2 15 2 2 2 2 2
20
1 2 3 4 3 3 3 3 ...

output:

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

result:

ok 1000000 numbers

Test #37:

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

input:

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

output:

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

result:

ok 1000000 numbers

Test #38:

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

input:

50000
20
1 2 3 4 4 4 4 4 4 10 10 10 13 10 10 10 10 10 10 10
20
1 1 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
20
1 1 1 1 5 6 5 8 9 9 9 9 9 9 9 16 17 16 16 16
20
1 1 3 3 3 3 3 3 3 10 3 3 3 14 3 3 3 3 3 3
20
1 2 3 4 5 6 7 8 6 6 11 6 6 14 6 6 6 6 19 6
20
1 2 2 4 4 4 4 8 9 8 8 8 8 8 8 16 8 8 8 8
20
1 1 1 4 5 4...

output:

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

result:

ok 1000000 numbers

Test #39:

score: -100
Runtime Error

input:

6414
137
1 2 1 1 1 1 1 1 1 1 1 1 1 14 15 14 14 14 14 14 14 14 14 14 14 14 27 28 27 27 27 27 27 27 27 27 27 27 27 40 41 40 40 40 40 40 40 40 40 40 40 40 53 54 53 53 53 53 53 53 53 53 53 53 53 66 67 68 66 66 71 66 66 74 66 66 77 66 79 80 81 82 80 80 85 80 87 88 89 87 87 92 87 94 95 94 94 94 94 94 101 ...

output:

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

result: