QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#239260#7678. The Gameucup-team130#AC ✓78ms12740kbC++173.2kb2023-11-04 19:32:192023-11-04 19:32:19

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 5976kb

input:

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

output:

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

result:

ok ok (6 test cases)

Test #2:

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

input:

7056
4 3
1 1 1 1
1 1 1
4 3
1 1 1 1
1 1 2
4 3
1 1 1 1
1 1 3
4 3
1 1 1 1
1 1 4
4 3
1 1 1 1
1 1 5
4 3
1 1 1 1
1 1 6
4 3
1 1 1 1
1 2 2
4 3
1 1 1 1
1 2 3
4 3
1 1 1 1
1 2 4
4 3
1 1 1 1
1 2 5
4 3
1 1 1 1
1 2 6
4 3
1 1 1 1
1 3 3
4 3
1 1 1 1
1 3 4
4 3
1 1 1 1
1 3 5
4 3
1 1 1 1
1 3 6
4 3
1 1 1 1
1 4 4
4 3
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
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 ok (7056 test cases)

Test #3:

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

input:

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

result:

ok ok (2640 test cases)

Test #5:

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

input:

14112
5 3
1 1 1 1 1
1 1 1
5 3
1 1 1 1 1
1 1 2
5 3
1 1 1 1 1
1 1 3
5 3
1 1 1 1 1
1 1 4
5 3
1 1 1 1 1
1 1 5
5 3
1 1 1 1 1
1 1 6
5 3
1 1 1 1 1
1 2 2
5 3
1 1 1 1 1
1 2 3
5 3
1 1 1 1 1
1 2 4
5 3
1 1 1 1 1
1 2 5
5 3
1 1 1 1 1
1 2 6
5 3
1 1 1 1 1
1 3 3
5 3
1 1 1 1 1
1 3 4
5 3
1 1 1 1 1
1 3 5
5 3
1 1 1 1 1
...

output:

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

result:

ok ok (14112 test cases)

Test #6:

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

input:

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

result:

ok ok (3234 test cases)

Test #8:

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

input:

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

result:

ok ok (8820 test cases)

Test #9:

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

input:

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

result:

ok ok (50000 test cases)

Test #11:

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

input:

25872
6 3
1 1 1 1 1 1
1 1 1
6 3
1 1 1 1 1 1
1 1 2
6 3
1 1 1 1 1 1
1 1 3
6 3
1 1 1 1 1 1
1 1 4
6 3
1 1 1 1 1 1
1 1 5
6 3
1 1 1 1 1 1
1 1 6
6 3
1 1 1 1 1 1
1 2 2
6 3
1 1 1 1 1 1
1 2 3
6 3
1 1 1 1 1 1
1 2 4
6 3
1 1 1 1 1 1
1 2 5
6 3
1 1 1 1 1 1
1 2 6
6 3
1 1 1 1 1 1
1 3 3
6 3
1 1 1 1 1 1
1 3 4
6 3
1 1 ...

output:

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

result:

ok ok (25872 test cases)

Test #12:

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

input:

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

output:

-1
-1
-1
-1
4
1 2 3 4 
-1
-1
-1
4
1 1 1 2 
4
1 1 2 3 
-1
-1
-1
4
1 1 2 2 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
4
2 3 4 5 
-1
-1
4
1 1 1 2 
4
1 1 2 3 
4
1 2 3 4 
-1
-1
4
1 1 2 2 
4
1 2 2 3 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
4
3 4 5 6 
-1
-1
4
1 1 1 3 
4
1 1 ...

result:

ok ok (25872 test cases)

Test #13:

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

input:

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

output:

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

result:

ok ok (13728 test cases)

Test #14:

score: 0
Accepted
time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
-1
-1
-1
3
1 1 1 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
3
2 3 4 
-1
-1
3
1 2 3 
-1
3
1 2 2 
-1
-1
-1
-1
-1
-1
3
1 1 ...

result:

ok ok (23100 test cases)

Test #16:

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

input:

41580
7 5
1 1 1 1 1 1 1
1 1 1 1 1
7 5
1 1 1 1 1 1 1
1 1 1 1 2
7 5
1 1 1 1 1 1 1
1 1 1 1 3
7 5
1 1 1 1 1 1 1
1 1 1 1 4
7 5
1 1 1 1 1 1 1
1 1 1 1 5
7 5
1 1 1 1 1 1 1
1 1 1 2 2
7 5
1 1 1 1 1 1 1
1 1 1 2 3
7 5
1 1 1 1 1 1 1
1 1 1 2 4
7 5
1 1 1 1 1 1 1
1 1 1 2 5
7 5
1 1 1 1 1 1 1
1 1 1 3 3
7 5
1 1 1 1 1 ...

output:

-1
-1
2
1 2 
-1
-1
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
-1
-1
-1
-1
-1
-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 ok (41580 test cases)

Test #17:

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

input:

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

result:

ok ok (16632 test cases)

Test #19:

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

input:

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

output:

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

result:

ok ok (27456 test cases)

Test #20:

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

input:

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

result:

ok ok (17325 test cases)

Test #22:

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

input:

13860
8 6
1 1 1 1 1 1 1 1
1 1 1 1 1 1
8 6
1 1 1 1 1 1 1 1
1 1 1 1 1 2
8 6
1 1 1 1 1 1 1 1
1 1 1 1 1 3
8 6
1 1 1 1 1 1 1 1
1 1 1 1 1 4
8 6
1 1 1 1 1 1 1 1
1 1 1 1 2 2
8 6
1 1 1 1 1 1 1 1
1 1 1 1 2 3
8 6
1 1 1 1 1 1 1 1
1 1 1 1 2 4
8 6
1 1 1 1 1 1 1 1
1 1 1 1 3 3
8 6
1 1 1 1 1 1 1 1
1 1 1 1 3 4
8 6
1 ...

output:

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

result:

ok ok (13860 test cases)

Test #23:

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

input:

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

result:

ok ok (15876 test cases)

Test #25:

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

input:

6000
50 30
2 3 3 1 10 6 8 8 6 8 6 2 4 7 1 2 9 10 3 7 2 4 9 7 10 8 1 2 10 9 2 2 1 10 8 2 6 3 3 9 1 1 9 7 6 6 5 8 10 8
5 4 4 4 9 2 3 4 8 3 10 5 7 3 7 7 10 2 8 5 9 10 1 5 10 8 2 4 2 8
50 30
5 2 2 8 10 9 4 1 8 8 6 10 6 9 2 1 2 2 3 9 10 10 5 1 6 7 4 4 6 5 7 3 1 2 5 2 4 7 10 5 8 5 2 10 8 6 1 1 10 7
2 6 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 ok (6000 test cases)

Test #26:

score: 0
Accepted
time: 26ms
memory: 4068kb

input:

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

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 ok (6000 test cases)

Test #27:

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

input:

3000
100 50
17 14 4 19 12 10 20 20 8 2 20 2 20 6 9 16 18 13 5 9 19 14 10 12 15 5 4 5 10 11 6 9 20 5 5 13 18 9 9 3 15 3 14 16 8 2 8 20 12 13 7 14 1 2 12 17 13 14 6 12 10 7 18 7 2 5 8 20 19 14 12 3 12 5 13 14 3 10 9 13 9 4 7 11 13 7 16 3 1 8 11 16 11 4 9 2 14 12 17 7
10 2 1 15 16 3 11 4 15 3 1 14 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 ok (3000 test cases)

Test #28:

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

input:

1500
200 100
3 2 6 6 3 4 10 5 10 10 2 10 4 8 1 3 4 1 2 1 2 9 10 6 9 4 2 3 1 6 4 1 6 5 7 1 3 7 3 9 8 1 5 5 8 6 8 4 4 2 5 5 2 4 4 1 2 5 2 10 9 2 9 9 4 10 3 10 10 6 9 3 1 1 3 8 8 10 8 4 1 6 10 4 8 5 2 2 10 3 3 6 5 7 8 5 1 9 10 3 9 4 5 5 2 2 3 9 4 1 1 5 9 1 8 4 9 4 9 3 7 10 7 3 9 6 2 4 5 2 10 5 1 2 4 3 ...

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 ok (1500 test cases)

Test #29:

score: 0
Accepted
time: 37ms
memory: 4620kb

input:

3
100000 98000
8 1 8 5 5 9 1 1 7 6 7 9 1 7 10 9 1 6 10 7 4 6 4 8 3 8 6 2 9 3 1 6 4 7 9 4 5 1 3 8 2 3 1 6 9 10 10 9 5 7 4 2 4 5 4 10 9 3 5 7 6 6 5 7 4 1 3 2 6 4 9 4 9 9 5 5 8 8 8 9 3 7 10 7 4 1 9 3 8 8 3 1 9 10 4 7 3 4 6 1 7 1 4 7 2 1 7 6 2 1 8 5 5 1 6 1 6 5 4 1 4 8 2 4 9 4 9 7 5 8 2 4 6 3 6 8 10 3 6...

output:

-1
-1
-1

result:

ok ok (3 test cases)

Test #30:

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

input:

3
100000 100
26628 15576 98990 43976 49647 68346 23924 26821 38507 73889 64208 7286 8583 43126 43052 76461 583 97495 60100 38769 3107 93747 71788 5884 62213 23247 35912 89245 73679 25668 84434 1943 8147 35006 4375 60512 7641 68542 90586 51747 18780 49625 38064 55647 67725 65368 51875 80357 97039 783...

output:

-1
-1
-1

result:

ok ok (3 test cases)

Test #31:

score: 0
Accepted
time: 21ms
memory: 3844kb

input:

6000
50 20
1 1 2 1 2 1 2 1 1 1 2 1 2 1 1 2 2 1 1 1 1 2 1 2 1 2 2 2 2 1 1 2 1 1 2 2 2 2 1 1 1 1 2 2 1 2 1 2 1 2
2 2 2 1 2 2 2 1 2 1 1 1 1 2 2 1 1 1 2 1
50 20
1 1 1 1 1 2 1 1 1 2 2 1 1 2 2 1 1 2 2 1 1 1 2 2 1 2 1 2 1 1 1 1 2 1 1 1 2 2 2 2 1 1 1 2 2 1 2 1 1 1
1 2 1 2 2 2 2 1 2 2 2 2 1 2 1 1 1 2 2 1
50 ...

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 ok (6000 test cases)

Test #32:

score: 0
Accepted
time: 42ms
memory: 5960kb

input:

30000
10 6
1 2 3 1 2 3 1 2 2 2
3 3 3 2 3 2
10 6
2 1 1 3 1 1 3 1 3 2
2 3 2 2 4 4
10 6
2 1 2 1 2 2 3 3 2 1
3 2 2 3 2 4
10 6
3 2 2 2 3 2 1 1 2 2
3 3 2 3 3 3
10 6
1 2 3 2 3 2 3 2 3 1
3 3 3 3 3 3
10 6
1 3 3 2 1 3 2 2 2 3
3 3 3 3 3 3
10 6
3 1 1 3 2 2 1 1 1 3
2 3 4 2 2 3
10 6
2 3 3 1 2 2 2 3 1 3
3 3 3 3 3 ...

output:

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

result:

ok ok (30000 test cases)

Test #33:

score: 0
Accepted
time: 42ms
memory: 4144kb

input:

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

output:

20
2 2 2 2 3 3 3 3 3 3 3 4 4 4 4 4 4 4 5 7 
20
2 2 3 3 3 3 3 3 4 4 4 4 4 4 4 5 5 8 9 9 
20
3 3 4 4 4 4 5 5 5 5 5 5 5 5 5 6 6 7 7 8 
19
3 3 3 3 3 3 4 4 4 4 4 4 4 4 5 6 7 9 10 
20
3 3 4 4 4 4 4 5 5 5 5 5 5 5 5 5 7 8 9 10 
20
3 3 3 4 4 4 4 4 4 4 4 4 4 5 5 6 8 8 9 10 
20
3 3 4 4 4 4 4 4 4 5 5 5 5 5 5 6 ...

result:

ok ok (6000 test cases)

Test #34:

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

input:

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

output:

20
4 4 4 4 4 4 5 5 5 5 5 5 7 8 10 11 12 13 14 14 
20
4 5 5 6 6 6 6 6 6 7 7 7 9 10 13 13 13 14 14 15 
20
5 5 6 6 6 6 6 6 7 8 8 8 8 9 9 10 11 13 14 14 
20
4 5 5 5 6 6 6 6 6 6 6 6 8 9 9 10 12 13 15 15 
20
4 5 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 13 
20
5 5 5 6 6 6 6 6 6 6 7 7 7 8 9 11 11 11 12 15 
20
4 4 ...

result:

ok ok (6000 test cases)

Test #35:

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

input:

6000
50 30
18 6 18 13 8 2 15 6 9 10 14 10 13 11 3 15 9 15 5 15 3 17 16 10 7 10 3 6 5 7 19 1 8 1 17 15 16 11 20 9 1 19 9 15 6 18 1 15 19 19
10 15 16 23 10 20 17 14 11 19 18 13 12 10 19 15 10 18 17 15 10 10 15 15 20 17 15 19 15 14
50 30
14 8 1 11 8 17 11 11 15 13 17 5 11 20 17 20 7 2 3 6 14 12 6 20 14...

output:

20
7 8 8 8 9 9 9 9 9 9 9 11 13 16 18 19 19 20 21 22 
20
6 6 6 7 7 7 7 7 7 7 8 9 11 11 12 12 13 14 14 17 
19
6 6 7 7 7 8 8 8 8 8 8 8 8 10 12 14 15 15 19 
20
5 5 5 6 6 6 7 7 7 7 8 8 9 10 14 16 16 17 18 18 
20
5 6 7 7 7 7 7 8 8 8 8 8 8 8 8 10 11 11 17 18 
20
7 7 8 8 8 8 9 9 11 12 12 15 15 15 16 16 20 2...

result:

ok ok (6000 test cases)

Test #36:

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

input:

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

output:

20
7 7 8 8 8 9 9 9 11 15 15 16 17 17 18 19 20 20 21 24 
20
9 10 10 10 11 11 12 17 18 18 19 19 20 20 21 22 22 23 24 24 
20
7 8 8 9 9 10 10 10 11 11 11 13 15 16 17 17 18 20 21 24 
20
8 9 9 10 10 10 12 12 12 13 13 13 15 16 16 16 17 21 22 23 
20
9 9 9 10 10 10 11 14 17 17 19 19 20 22 24 25 25 25 26 26 
...

result:

ok ok (6000 test cases)

Test #37:

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

input:

300
1000 800
246 508 46 134 515 412 848 608 126 798 725 18 702 267 623 808 446 816 99 663 688 254 834 715 357 241 843 849 414 522 744 478 887 341 100 598 758 420 988 141 513 994 699 642 213 896 515 687 895 459 211 131 335 44 220 536 632 951 11 709 730 204 475 436 152 250 920 461 547 575 204 794 908 ...

output:

200
183 184 184 184 185 185 185 186 186 186 186 187 187 187 187 188 188 188 188 189 189 189 189 189 190 190 190 190 190 190 191 191 191 191 191 191 191 192 192 192 192 192 192 192 192 193 193 193 193 193 193 193 193 194 194 194 194 194 194 194 194 195 195 195 195 195 195 195 195 196 196 196 196 196 ...

result:

ok ok (300 test cases)

Test #38:

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

input:

300
1000 700
387 402 514 158 333 626 917 599 37 843 654 459 642 305 227 87 613 628 210 356 582 589 283 551 733 596 800 242 385 116 4 680 653 757 937 956 910 994 920 59 830 209 213 669 956 886 441 632 450 319 151 381 566 17 703 705 745 962 965 406 971 309 762 943 309 81 490 7 917 194 797 907 670 487 ...

output:

300
287 288 289 290 291 291 292 292 292 293 293 293 294 294 294 295 295 295 295 295 296 296 296 296 296 297 297 297 297 297 298 298 298 298 298 298 299 299 299 299 299 299 299 300 300 300 300 300 300 300 300 301 301 301 301 301 301 301 301 301 302 302 302 302 302 302 302 302 302 302 302 303 303 303 ...

result:

ok ok (300 test cases)

Test #39:

score: 0
Accepted
time: 46ms
memory: 6156kb

input:

300
1000 500
943 269 325 447 277 43 67 545 274 64 681 119 645 971 776 371 889 457 421 939 868 913 575 200 177 215 996 552 582 737 533 756 791 21 749 923 801 817 878 861 104 218 260 898 89 550 919 209 792 665 686 9 988 884 127 475 398 449 392 709 262 385 129 433 558 702 79 132 165 73 499 703 557 805 ...

output:

500
462 463 463 464 464 465 465 466 466 466 467 467 467 468 468 468 468 469 469 469 469 470 470 470 470 471 471 471 471 472 472 472 472 473 473 473 473 473 473 474 474 474 474 474 474 474 475 475 475 475 475 475 475 475 475 476 476 476 476 476 476 476 476 476 476 477 477 477 477 477 477 477 477 477 ...

result:

ok ok (300 test cases)

Test #40:

score: 0
Accepted
time: 54ms
memory: 3888kb

input:

300
1000 300
343 99 102 991 677 740 397 454 501 724 261 765 82 256 538 785 427 409 680 269 740 747 443 601 421 838 349 174 754 96 36 419 361 290 865 915 63 582 730 661 683 408 272 123 114 834 746 699 305 933 273 729 934 647 786 27 376 600 839 123 658 796 582 145 68 812 200 855 546 796 283 811 851 70...

output:

700
665 666 666 667 667 667 667 668 668 668 668 668 668 669 669 669 669 669 669 670 670 670 670 670 670 670 670 671 671 671 671 671 671 671 671 671 671 672 672 672 672 672 672 672 672 672 672 673 673 673 673 673 673 673 673 673 674 674 674 674 674 674 674 674 674 674 675 675 675 675 675 675 675 675 ...

result:

ok ok (300 test cases)

Test #41:

score: 0
Accepted
time: 53ms
memory: 3856kb

input:

300
1000 100
594 996 948 260 612 869 679 466 541 85 604 111 991 9 16 833 786 215 786 930 343 557 952 6 926 432 898 120 577 166 958 877 927 157 443 551 858 89 758 395 473 690 824 635 127 467 765 166 770 812 254 475 997 473 496 625 894 618 179 242 312 665 677 796 731 407 132 727 231 630 935 417 909 51...

output:

900
872 872 873 873 873 874 874 874 874 875 875 875 875 875 876 876 876 876 876 876 877 877 877 877 877 877 877 877 878 878 878 878 878 878 878 878 879 879 879 879 879 879 879 879 879 880 880 880 880 880 880 880 880 880 880 881 881 881 881 881 881 881 881 881 881 882 882 882 882 882 882 882 882 882 ...

result:

ok ok (300 test cases)

Test #42:

score: 0
Accepted
time: 38ms
memory: 5048kb

input:

3
100000 80021
33 74 99 100 44 49 33 41 61 15 26 74 26 79 43 74 99 42 25 64 81 18 75 77 14 34 89 44 55 52 87 97 6 47 100 93 8 97 83 44 56 62 34 44 42 91 50 43 9 1 56 89 45 79 39 15 70 92 80 65 96 66 25 54 93 43 82 14 45 48 87 27 9 57 16 49 27 19 63 64 4 27 81 46 95 68 17 9 12 44 92 30 78 99 84 97 10...

output:

19979
16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 ...

result:

ok ok (3 test cases)

Test #43:

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

input:

3
100000 70031
67 88 52 29 20 47 14 24 55 21 21 67 1 19 68 85 9 85 48 14 9 70 59 42 19 74 97 24 74 99 38 81 67 96 89 41 52 33 4 54 44 85 85 41 16 43 22 14 67 81 22 32 76 32 58 31 7 42 86 12 4 15 37 100 36 33 48 9 73 71 84 40 7 54 43 86 1 79 23 23 28 94 87 18 45 91 8 7 1 59 69 3 96 35 79 100 24 46 94...

output:

29969
25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 ...

result:

ok ok (3 test cases)

Test #44:

score: 0
Accepted
time: 46ms
memory: 5968kb

input:

3
100000 60040
6 9 13 59 88 49 98 23 61 18 13 60 68 63 89 96 19 35 83 56 34 30 32 12 21 9 1 93 5 46 81 69 23 37 62 77 91 69 24 68 23 100 28 33 86 6 86 89 10 58 81 62 2 89 81 50 56 5 88 70 16 56 58 43 79 14 19 92 98 2 77 50 96 54 67 19 87 50 75 83 56 70 89 99 78 21 2 96 99 74 50 72 27 75 74 6 55 64 6...

output:

39960
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 ...

result:

ok ok (3 test cases)

Test #45:

score: 0
Accepted
time: 53ms
memory: 6236kb

input:

3
100000 50038
44 23 69 88 65 43 70 13 55 12 9 62 44 6 10 14 25 86 7 9 58 87 17 82 22 49 21 73 32 89 32 53 83 86 47 21 19 5 52 81 18 14 83 30 60 73 51 68 68 26 39 93 33 46 96 61 97 68 97 20 25 92 79 86 23 95 77 91 14 29 74 52 90 54 98 60 57 18 32 51 75 41 3 75 27 47 93 90 93 97 23 54 50 14 66 8 82 8...

output:

49962
45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 ...

result:

ok ok (3 test cases)

Test #46:

score: 0
Accepted
time: 68ms
memory: 7424kb

input:

1
300000 170000
709767392 991931703 440786157 420253632 70142923 541765687 58272546 934857792 30813956 431614551 455745309 196615204 410670889 331951123 899394213 949683236 794740169 16996863 148141492 243752523 547346921 684101439 41901818 592233592 31232642 849937933 205471831 209747680 804177152 ...

output:

130000
433394363 433394364 433394365 433394366 433394367 433394368 433394369 433394370 433394371 433394372 433394373 433394374 433394375 433394376 433394377 433394378 433394379 433394380 433394381 433394382 433394383 433394384 433394385 433394386 433394387 433394388 433394389 433394390 433394391 433...

result:

ok ok (1 test case)

Test #47:

score: 0
Accepted
time: 70ms
memory: 7740kb

input:

1
300000 190000
193508934 46076682 94370302 52894499 634904456 988948610 698385762 950193352 828783879 345250094 12189368 547695598 989698943 237711329 383431024 616715369 380412465 439251856 936489405 706380401 185070436 962014678 349821717 1770274 426578143 932462449 882866357 863062269 735148145 ...

output:

110000
366316449 366316450 366316451 366316452 366316453 366316454 366316455 366316456 366316457 366316458 366316459 366316460 366316461 366316462 366316463 366316464 366316465 366316466 366316467 366316468 366316469 366316470 366316471 366316472 366316473 366316474 366316475 366316476 366316477 366...

result:

ok ok (1 test case)

Test #48:

score: 0
Accepted
time: 75ms
memory: 8040kb

input:

1
300000 210000
937943941 958476582 972740800 999057430 242618296 218037725 909526285 247297242 45499636 953602396 383233664 421568137 15340322 724959104 431661683 294339778 291057712 476111821 872234116 439231753 271475341 742857192 38088985 246106951 300812719 887886874 803950038 697067081 9689621...

output:

90000
300582001 300582002 300582003 300582004 300582005 300582006 300582007 300582008 300582009 300582010 300582011 300582012 300582013 300582014 300582015 300582016 300582017 300582018 300582019 300582020 300582021 300582022 300582023 300582024 300582025 300582026 300582027 300582028 300582029 3005...

result:

ok ok (1 test case)

Test #49:

score: 0
Accepted
time: 62ms
memory: 6872kb

input:

1
300000 120000
420931274 771490051 708595377 566813126 888259157 646597524 769075018 228502759 932704164 688518992 816275899 877437151 875815985 247013832 3094580 153282626 903178752 787225778 649868711 731487240 548510740 789313641 308648524 42171918 92650743 727271019 12221471 346767763 547922230...

output:

180000
599977319 599977320 599977321 599977322 599977323 599977324 599977325 599977326 599977327 599977328 599977329 599977330 599977331 599977332 599977333 599977334 599977335 599977336 599977337 599977338 599977339 599977340 599977341 599977342 599977343 599977344 599977345 599977346 599977347 599...

result:

ok ok (1 test case)

Test #50:

score: 0
Accepted
time: 72ms
memory: 9352kb

input:

1
300000 110000
782432177 323122642 481986660 427741633 168146109 468551284 950318446 80481262 465290345 106453109 974708149 430452616 506448773 781688335 370463621 839712724 432985463 996391985 643703038 812322315 221974202 564019966 926530708 204528089 966633818 41679948 991334285 129691104 279269...

output:

190000
632573755 632573756 632573757 632573758 632573759 632573760 632573761 632573762 632573763 632573764 632573765 632573766 632573767 632573768 632573769 632573770 632573771 632573772 632573773 632573774 632573775 632573776 632573777 632573778 632573779 632573780 632573781 632573782 632573783 632...

result:

ok ok (1 test case)

Test #51:

score: 0
Accepted
time: 78ms
memory: 8616kb

input:

1
300000 240000
940862482 153089417 475587380 26434764 239084494 376280796 208558342 101344679 601910715 244213713 136750605 721370584 827367715 179587448 839559976 22628176 312427413 166250180 737789877 989387813 49772902 16015631 858467356 856103698 307175979 335025812 721521732 795919349 28577568...

output:

60000
199372132 199372133 199372134 199372135 199372136 199372137 199372138 199372139 199372140 199372141 199372142 199372143 199372144 199372145 199372146 199372147 199372148 199372149 199372150 199372151 199372152 199372153 199372154 199372155 199372156 199372157 199372158 199372159 199372160 1993...

result:

ok ok (1 test case)

Test #52:

score: 0
Accepted
time: 56ms
memory: 7956kb

input:

1
300000 170015
381 505 541 790 757 439 322 481 205 597 11 632 931 455 785 924 913 171 575 424 645 445 13 239 536 137 38 596 271 429 386 704 629 116 421 231 879 268 958 603 326 993 329 208 345 752 469 814 208 748 711 979 370 677 846 126 384 940 932 469 632 81 75 32 419 437 694 611 350 344 235 312 37...

output:

129985
410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 410 4...

result:

ok ok (1 test case)

Test #53:

score: 0
Accepted
time: 55ms
memory: 7376kb

input:

1
300000 100013
929 650 525 808 226 345 356 187 446 576 31 447 776 194 901 904 971 819 570 237 980 344 669 116 795 748 424 683 918 412 780 568 567 596 874 995 65 88 202 479 254 460 280 92 764 516 266 64 699 173 180 889 817 602 132 812 854 176 638 162 272 922 104 206 888 981 975 32 316 885 345 229 18...

output:

199987
633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 633 6...

result:

ok ok (1 test case)

Test #54:

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

input:

1
300000 250000
105 646 656 153 939 189 363 368 120 161 644 928 542 788 867 88 265 901 404 495 572 481 319 562 636 13 344 724 213 605 976 665 394 985 58 442 833 306 991 36 205 610 771 400 587 985 533 197 733 680 355 322 762 722 436 396 828 718 204 734 400 615 483 452 978 644 102 503 358 216 109 644 ...

output:

50000
159 159 159 159 159 159 159 159 159 159 159 159 159 159 159 159 159 159 159 159 159 159 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 160 16...

result:

ok ok (1 test case)

Test #55:

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

input:

1
300000 120021
884 823 816 15 283 962 640 504 440 69 628 692 89 805 496 282 725 345 198 453 487 142 596 628 775 926 763 216 9 284 417 472 764 57 888 272 579 891 349 165 216 553 553 139 220 200 244 16 680 417 165 286 512 512 43 284 611 207 15 374 844 201 511 593 908 343 117 1000 621 590 70 994 936 7...

output:

179979
575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 575 5...

result:

ok ok (1 test case)

Test #56:

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

input:

300
1000 300
691 841 625 737 413 460 409 596 319 284 517 674 544 637 621 358 869 687 439 521 259 237 572 744 213 617 488 565 587 166 765 320 225 181 264 185 692 345 619 560 569 331 818 934 326 726 502 81 647 820 517 636 818 751 551 436 52 745 331 420 553 461 304 218 703 323 372 64 412 952 201 796 63...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
700
671 672 672 673 673 674 674 675 675 676 676 676 676 677 677 677 677 677 678 678 678 678 678 679 679 679 679 679 679 680 680 680 680 680 680 681 681 681 681 681 681 681 681 682 682 682 682 682 682 682 682 682 682 683 683 683 683 683 683 683 683 6...

result:

ok ok (300 test cases)

Test #57:

score: 0
Accepted
time: 53ms
memory: 3888kb

input:

300
1000 101
439 550 130 321 685 852 667 621 723 524 452 202 528 628 125 260 48 641 835 678 929 362 335 863 542 949 759 432 255 392 332 272 359 265 43 472 125 326 868 792 692 175 470 336 914 575 305 784 533 926 306 272 113 369 434 512 515 769 496 946 418 704 762 827 392 191 256 326 365 475 722 432 4...

output:

-1
899
875 876 876 877 877 878 878 878 878 878 879 879 879 879 879 879 880 880 880 880 880 880 880 880 881 881 881 881 881 881 881 881 881 881 882 882 882 882 882 882 882 882 882 882 882 883 883 883 883 883 883 883 883 883 883 883 883 883 884 884 884 884 884 884 884 884 884 884 884 884 884 884 885 8...

result:

ok ok (300 test cases)

Test #58:

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

input:

3
100000 80016
77 32 77 53 21 33 26 97 39 66 70 65 63 91 64 97 62 69 66 12 59 27 58 30 27 55 46 57 21 70 61 88 43 56 8 27 87 39 90 37 75 47 85 33 27 99 90 53 76 23 4 86 66 75 78 2 87 39 88 77 1 1 6 89 54 28 10 13 83 97 73 42 21 29 46 5 14 64 74 14 60 53 9 76 67 36 64 59 30 74 5 41 43 5 78 14 48 69 4...

output:

-1
-1
-1

result:

ok ok (3 test cases)

Test #59:

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

input:

3
100000 70016
27 42 70 76 44 64 30 68 73 77 74 77 60 96 59 71 51 67 7 65 28 61 76 81 7 57 32 5 4 73 59 91 34 87 77 11 73 92 93 61 33 92 27 40 29 35 78 96 97 68 71 34 55 40 20 44 86 95 82 8 87 76 59 65 71 48 29 10 35 23 1 25 91 82 13 30 18 26 7 73 72 68 63 83 73 27 61 57 83 21 57 100 39 18 85 91 80 ...

output:

29984
25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 ...

result:

ok ok (3 test cases)

Test #60:

score: 0
Accepted
time: 54ms
memory: 7568kb

input:

1
300000 230010
897 623 888 292 809 692 387 896 943 932 304 297 692 366 947 282 953 358 832 42 288 685 9 1 936 207 633 71 60 507 964 174 765 119 148 539 732 674 438 545 321 737 147 357 751 786 312 523 285 131 422 128 246 916 290 141 258 832 214 819 915 297 798 329 785 601 836 232 214 154 597 568 595...

output:

69990
217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 21...

result:

ok ok (1 test case)

Test #61:

score: 0
Accepted
time: 59ms
memory: 8972kb

input:

1
300000 150016
1236 1469 902 1714 10 1447 907 249 1895 165 1498 1964 1141 1622 1620 1095 463 1729 1071 937 1875 1325 660 1892 407 1015 1890 559 193 463 298 676 270 1530 449 754 172 561 1649 1419 591 113 8 631 672 1386 231 1936 377 880 148 1556 218 1789 1464 1703 1864 1709 1202 1134 232 1936 787 388...

output:

149984
965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 965 966 966 966 966 966 966 966 966 966 966 966 966 966 966 966 9...

result:

ok ok (1 test case)

Test #62:

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

input:

1
300000 200012
571 81 248 126 847 51 482 746 518 366 418 926 287 81 899 914 718 740 489 305 60 869 344 520 77 163 237 75 312 142 594 370 803 781 558 24 325 534 171 364 914 849 639 481 923 325 35 438 811 66 719 39 891 422 428 361 134 697 640 97 718 632 166 54 853 813 619 556 789 165 634 958 409 633 ...

output:

99988
312 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 313 31...

result:

ok ok (1 test case)

Test #63:

score: 0
Accepted
time: 61ms
memory: 10340kb

input:

1
300000 80046
114 853 56 319 707 33 570 87 378 860 968 447 17 731 728 539 63 934 851 855 170 562 927 730 288 398 173 558 244 505 996 562 200 298 860 616 397 671 748 991 428 559 814 113 744 576 965 526 418 209 197 904 812 169 356 13 687 423 121 129 317 551 884 401 583 267 134 504 168 992 524 134 551...

output:

219954
705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 705 7...

result:

ok ok (1 test case)

Test #64:

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

input:

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

output:

0

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-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 ok (10000 test cases)

Test #65:

score: 0
Accepted
time: 46ms
memory: 8036kb

input:

3
100000 30695
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

69305
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 ok (3 test cases)

Test #66:

score: 0
Accepted
time: 49ms
memory: 7940kb

input:

3
100000 31831
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

68169
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 ok (3 test cases)

Test #67:

score: 0
Accepted
time: 50ms
memory: 6824kb

input:

3
100000 30000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 ok (1 test case)

Test #69:

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

input:

1
300000 102329
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

197671
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 ok (1 test case)

Test #70:

score: 0
Accepted
time: 49ms
memory: 12740kb

input:

1
300000 100000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 ok (1 test case)

Test #71:

score: 0
Accepted
time: 65ms
memory: 7588kb

input:

1
300000 1
71816290 577646983 841557369 852043746 37126487 102223060 27715306 985870035 216706329 968907371 382088914 712120946 646596707 19156351 54849033 944516763 64421318 280320825 263193207 301370979 636866597 205058358 906742170 462877840 983077175 366579207 454735621 343423516 635019273 91142...

output:

299999
999940776 999940777 999940778 999940779 999940780 999940781 999940782 999940783 999940784 999940785 999940786 999940787 999940788 999940789 999940790 999940791 999940792 999940793 999940794 999940795 999940796 999940797 999940798 999940799 999940800 999940801 999940802 999940803 999940804 999...

result:

ok ok (1 test case)

Test #72:

score: 0
Accepted
time: 61ms
memory: 7580kb

input:

1
300000 1
218913978 615464987 743073221 515774957 831116744 706991219 714083282 132771050 486347397 612395546 905208402 292753830 845992678 608321189 209744867 361269104 223173331 27182269 701530201 445755372 436970664 940306081 790682425 212538258 723697592 87734945 465842238 540595244 9553605 886...

output:

299999
999941968 999941969 999941970 999941971 999941972 999941973 999941974 999941975 999941976 999941977 999941978 999941979 999941980 999941981 999941982 999941983 999941984 999941985 999941986 999941987 999941988 999941989 999941990 999941991 999941992 999941993 999941994 999941995 999941996 999...

result:

ok ok (1 test case)

Test #73:

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

input:

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

299999
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 1...

result:

ok ok (1 test case)

Test #74:

score: 0
Accepted
time: 67ms
memory: 10708kb

input:

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

299999
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 ok (1 test case)

Extra Test:

score: 0
Extra Test Passed