QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#589677#5550. JOIRISNova_NightWind031130 1ms3984kbC++202.5kb2024-09-25 19:34:032024-09-25 19:34:06

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 15
Accepted

Test #1:

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

input:

34 2
2
5
41
47
8
27
42
17
43
47
47
12
49
33
41
18
4
16
15
28
9
13
25
44
20
40
25
16
2
20
0
41
6
16

output:

-1

result:

ok 

Test #2:

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

input:

26 2
32
42
0
0
20
22
4
19
13
37
22
30
50
17
23
1
11
7
22
3
26
25
45
32
38
38

output:

-1

result:

ok 

Test #3:

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

input:

32 2
3
42
8
32
34
44
2
4
19
40
49
47
25
6
46
7
40
22
38
6
32
45
4
35
16
29
47
6
1
22
0
14

output:

-1

result:

ok 

Test #4:

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

input:

28 2
9
21
26
30
0
46
33
7
36
29
28
0
33
21
29
37
15
44
33
14
14
34
32
4
49
23
48
19

output:

441
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 9
1 9
1 9
1 9
1 9
1 9
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 11
1 11
1 11
1 11
1 11
1 11
1 11
1 11
1 11
1 11
1 11...

result:

ok 

Test #5:

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

input:

48 2
46
2
38
42
24
39
45
26
36
10
43
12
44
44
9
23
5
38
1
25
31
46
21
5
0
19
49
28
0
2
39
4
42
29
5
28
46
20
13
44
6
8
26
43
7
11
15
2

output:

-1

result:

ok 

Test #6:

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

input:

12 2
30
34
48
32
0
10
20
21
36
8
12
19

output:

171
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
...

result:

ok 

Test #7:

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

input:

28 2
23
5
49
37
34
46
50
15
14
12
28
13
38
21
2
19
13
21
0
35
42
28
35
7
44
15
13
44

output:

-1

result:

ok 

Test #8:

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

input:

38 2
42
43
50
3
2
50
23
16
26
45
17
32
20
8
45
17
3
6
12
4
14
26
43
9
49
46
37
12
9
1
12
31
34
35
10
7
32
0

output:

-1

result:

ok 

Test #9:

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

input:

42 2
44
20
50
41
29
16
14
21
34
43
23
19
50
3
16
49
18
22
21
49
29
48
33
44
17
0
26
26
39
24
6
29
5
39
40
25
4
50
48
6
1
39

output:

953
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 4
1 4
1 4
1 4
1 4
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
...

result:

ok 

Test #10:

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

input:

8 2
19
24
12
6
0
21
42
11

output:

-1

result:

ok 

Test #11:

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

input:

2 2
0
1

output:

-1

result:

ok 

Test #12:

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

input:

2 2
50
0

output:

25
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2

result:

ok 

Test #13:

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

input:

50 2
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1

output:

-1

result:

ok 

Test #14:

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

input:

50 2
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0

output:

-1

result:

ok 

Test #15:

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

input:

50 2
0
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50

output:

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

Test #16:

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

input:

50 2
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
0
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50

output:

25
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27

result:

ok 

Subtask #2:

score: 15
Accepted

Test #17:

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

input:

3 2
38
27
0

output:

29
1 2
1 2
1 2
1 2
1 2
1 2
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
2 1
1 1
2 2

result:

ok 

Test #18:

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

input:

27 2
31
48
37
30
48
31
7
0
43
22
34
18
7
34
15
29
35
22
28
27
38
15
29
30
35
8
15

output:

533
1 3
1 3
1 3
1 3
1 3
1 3
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 5
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 6
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
...

result:

ok 

Test #19:

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

input:

19 2
26
12
20
18
44
46
2
28
17
47
3
35
0
42
43
40
4
45
42

output:

237
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 3
1 3
1 3
1 4
1 4
1 4
1 4
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 11
1 11
1 11
1 11
1 11
1 11
1 11
1 11
1 11
1 11
1 11
1...

result:

ok 

Test #20:

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

input:

29 2
40
19
38
29
10
48
4
3
30
42
29
21
28
27
43
2
7
24
27
39
0
13
21
35
48
15
7
33
34

output:

541
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 3
1 3
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
1 8
...

result:

ok 

Test #21:

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

input:

31 2
2
12
34
40
35
39
47
46
5
9
17
18
24
38
41
48
44
0
30
13
2
20
16
47
12
41
24
31
31
43
6

output:

538
1 5
1 5
1 5
1 6
1 8
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 11
1 11
1 11
1 11
1 11
1 11
1 11
1 11
1 11
1 11
1 11
1 11
1 11
1 11
1 11
1 11
1 12
1 1...

result:

ok 

Test #22:

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

input:

5 2
29
14
34
0
14

output:

42
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
2 1
2 1
2 1
2 1
1 1
2 2
2 4

result:

ok 

Test #23:

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

input:

7 2
18
38
0
7
7
45
43

output:

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

result:

ok 

Test #24:

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

input:

19 2
21
6
30
23
38
46
10
37
3
39
35
13
0
6
44
41
45
22
14

output:

248
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 4
1 4
1 4
1 4
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 8
1 8
1 8
1 8
1 8
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 10
1 10
1 10
1 10
1 11
1 11
1 11
1 11
1 11
1 11
1 12
1 12
1 12
1 1...

result:

ok 

Test #25:

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

input:

19 2
47
30
36
24
22
25
5
9
20
7
19
8
44
11
45
24
22
0
48

output:

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

result:

ok 

Test #26:

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

input:

19 2
8
11
10
27
23
26
9
36
3
2
46
0
47
46
26
29
19
5
0

output:

298
1 3
1 5
1 5
1 6
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 7
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 12
1 12
1 12
1 12
1 12
1 12
1 12
1 12
1 12
1 12
1 12
1 12
1 12
1 12
1 12
1 12
1 ...

result:

ok 

Test #27:

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

input:

3 2
0
1
2

output:

3
2 1
1 1
2 2

result:

ok 

Test #28:

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

input:

3 2
0
2
1

output:

3
1 3
2 1
1 1

result:

ok 

Test #29:

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

input:

49 2
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0

output:

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

result:

ok 

Test #30:

score: 15
Accepted
time: 1ms
memory: 3932kb

input:

49 2
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1

output:

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

result:

ok 

Test #31:

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

input:

49 2
0
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50

output:

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

Test #32:

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

input:

49 2
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
0
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50

output:

25
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27
1 27

result:

ok 

Subtask #3:

score: 0
Wrong Answer

Dependency #1:

100%
Accepted

Test #33:

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

input:

3 3
20
0
26

output:

-1

result:

ok 

Test #34:

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

input:

4 2
21
36
0
19

output:

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

result:

ok 

Test #35:

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

input:

10 5
2
27
17
0
4
26
7
50
41
3

output:

-1

result:

ok 

Test #36:

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

input:

24 6
27
20
23
19
30
40
49
35
19
27
7
45
37
17
0
11
36
2
32
28
43
39
23
16

output:

-1

result:

ok 

Test #37:

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

input:

39 13
34
40
36
9
46
24
34
0
14
44
3
42
7
43
43
12
24
18
31
48
36
2
34
33
48
47
11
16
18
39
3
38
11
41
42
8
15
23
36

output:

-1

result:

ok 

Test #38:

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

input:

42 7
9
19
27
32
23
49
20
19
26
28
24
21
27
44
29
40
3
47
29
5
46
24
21
45
9
1
2
23
50
24
37
0
18
6
27
27
18
34
20
30
27
11

output:

-1

result:

ok 

Test #39:

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

input:

46 23
36
40
6
34
18
0
16
32
4
18
13
47
4
45
27
30
16
21
26
11
21
34
35
28
36
28
24
8
20
36
1
12
29
49
21
15
30
41
33
32
44
46
6
11
10
15

output:

-1

result:

ok 

Test #40:

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

input:

47 47
18
21
16
42
0
7
5
11
14
15
45
41
2
17
32
40
16
33
24
32
10
10
49
34
44
12
33
14
34
47
40
22
39
48
11
23
32
44
44
48
45
22
37
26
49
5
18

output:

-1

result:

ok 

Test #41:

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

input:

49 7
50
9
16
17
5
47
18
0
6
45
28
10
30
34
6
0
27
1
11
39
2
6
1
39
33
6
5
2
12
11
41
16
11
38
39
12
6
6
39
34
0
48
15
49
30
14
50
8
27

output:

-1

result:

ok 

Test #42:

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

input:

50 5
45
27
44
21
35
4
39
0
47
6
46
11
47
39
47
42
25
18
15
20
18
16
34
0
43
46
1
42
18
20
41
38
45
40
37
44
11
3
39
28
21
47
2
31
30
13
18
16
30
8

output:

-1

result:

ok 

Test #43:

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

input:

48 4
1
0
1
2
1
0
1
2
1
0
1
2
1
0
1
2
1
0
1
2
1
0
1
2
1
0
1
2
1
0
1
2
1
0
1
2
1
0
1
2
1
0
1
2
1
0
1
2

output:

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

result:

ok 

Test #44:

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

input:

4 2
6
0
4
10

output:

10
1 2
1 2
1 2
1 3
2 2
2 2
2 2
2 2
1 1
1 1

result:

ok 

Test #45:

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

input:

10 5
27
25
46
22
24
19
21
0
24
22

output:

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

result:

ok 

Test #46:

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

input:

24 6
3
2
4
4
4
3
4
2
4
4
2
2
3
11
2
2
6
7
5
0
5
5
3
3

output:

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

result:

ok 

Test #47:

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

input:

39 13
24
26
29
33
25
31
30
25
0
34
29
30
27
33
26
26
23
30
23
25
27
43
23
29
25
27
26
31
28
27
28
29
28
31
40
26
25
28
29

output:

667
1 5
1 6
1 7
1 7
1 8
1 8
1 8
1 9
1 9
1 9
1 9
1 9
1 10
1 10
1 10
1 11
1 11
1 11
1 11
1 12
1 12
1 12
1 12
1 13
1 13
1 13
1 13
1 13
1 14
1 14
1 14
1 14
1 14
1 15
1 15
1 15
1 15
1 15
1 15
1 16
1 16
1 16
1 16
1 16
1 16
1 17
1 17
1 17
1 17
1 17
1 17
1 17
1 18
1 18
1 18
1 18
1 18
1 18
1 18
1 19
1 19
1 1...

result:

ok 

Test #48:

score: 15
Accepted
time: 1ms
memory: 3908kb

input:

42 7
8
9
0
5
10
8
8
9
11
6
11
13
8
10
8
12
8
10
5
9
6
5
5
12
8
6
6
11
9
4
12
10
6
8
8
10
8
11
5
9
10
6

output:

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

result:

ok 

Test #49:

score: 15
Accepted
time: 1ms
memory: 3784kb

input:

46 23
13
7
8
8
9
11
9
8
9
10
12
19
10
9
5
9
11
10
6
6
9
8
10
6
12
11
11
10
8
10
11
10
9
7
0
9
10
14
10
8
9
13
13
10
11
9

output:

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

result:

ok 

Test #50:

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

input:

48 4
1
2
3
36
0
3
2
50
1
2
3
36
0
3
2
50
1
2
3
36
0
3
2
50
1
2
3
36
0
3
2
50
1
2
3
36
0
3
2
50
1
2
3
36
0
3
2
50

output:

-1

result:

ok 

Test #51:

score: 15
Accepted
time: 1ms
memory: 3976kb

input:

49 7
4
7
7
8
7
9
4
9
3
8
7
4
7
8
7
10
5
4
12
3
10
7
6
7
6
5
5
13
11
4
6
10
8
12
0
8
9
5
8
8
8
6
3
10
11
6
5
5
8

output:

938
1 5
1 6
1 7
1 7
1 8
1 8
1 9
1 9
1 9
1 10
1 10
1 10
1 11
1 11
1 11
1 11
1 12
1 12
1 12
1 12
1 12
1 13
1 13
1 13
1 13
1 13
1 14
1 14
1 14
1 14
1 14
1 15
1 15
1 15
1 15
1 15
1 15
1 16
1 16
1 16
1 16
1 16
1 16
1 17
1 17
1 17
1 17
1 17
1 17
1 17
1 18
1 18
1 18
1 18
1 18
1 18
1 18
1 18
1 19
1 19
1 19
...

result:

ok 

Test #52:

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

input:

50 5
6
3
11
2
3
1
8
4
5
11
8
2
5
8
6
3
4
4
4
4
5
8
4
3
3
6
7
5
8
0
9
5
3
5
5
2
1
6
6
7
6
6
4
5
6
2
4
2
2
3

output:

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

result:

ok 

Test #53:

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

input:

2 1
50
0

output:

50
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2

result:

ok 

Test #54:

score: 0
Wrong Answer
time: 0ms
memory: 3964kb

input:

5 1
0
1
2
3
4

output:

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

result:

wrong answer 

Subtask #4:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

0%