QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#95681#5470. Hasty Santa ClausGuanYunchangTL 11ms3536kbC++11783b2023-04-11 13:04:312023-04-11 13:04:34

詳細信息

Test #1:

score: 100
Accepted
time: 3ms
memory: 3440kb

input:

5 1
23 25
23 27
24 25
25 25
25 26

output:

23
27
24
25
26

result:

ok ok

Test #2:

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

input:

7 2
1 31
1 31
1 31
1 31
1 31
1 31
1 31

output:

23
27
19
2
25
6
12

result:

ok ok

Test #3:

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

input:

6 2
24 25
24 25
24 25
25 26
25 26
25 26

output:

24
25
24
26
25
26

result:

ok ok

Test #4:

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

input:

20 5
9 26
7 29
7 30
4 30
4 27
19 30
8 27
13 25
6 29
1 25
8 31
2 29
13 25
9 26
8 31
1 28
8 26
3 26
5 25
1 28

output:

14
19
10
25
21
24
15
16
20
16
13
11
23
13
10
3
25
5
25
3

result:

ok ok

Test #5:

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

input:

100 5
9 25
2 30
2 31
4 29
2 25
1 27
7 26
3 25
15 30
2 26
9 26
2 30
6 30
24 31
7 28
15 27
2 29
23 31
18 29
23 31
1 31
2 27
7 29
2 27
23 31
16 31
17 31
10 29
4 30
3 26
2 26
19 28
1 30
8 30
4 31
10 29
1 31
22 30
6 29
3 26
3 30
5 28
1 31
9 28
2 30
2 26
13 30
4 25
2 27
1 25
5 27
5 26
9 27
1 28
19 31
5 31...

output:

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

result:

ok ok

Test #6:

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

input:

100 50
3 27
6 25
1 31
2 29
24 31
5 31
14 31
9 25
11 26
25 30
7 30
24 28
10 30
2 26
1 26
1 25
6 31
23 31
5 28
4 28
2 25
1 26
4 30
6 27
7 29
11 31
3 29
23 28
3 26
4 31
10 29
1 30
8 25
17 25
7 25
8 28
23 29
1 27
1 25
6 30
1 29
13 25
5 30
1 30
1 29
2 31
9 27
4 25
1 31
1 25
18 31
3 27
12 31
7 29
13 30
1 ...

output:

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

result:

ok ok

Test #7:

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

input:

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

output:

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

result:

ok ok

Test #8:

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

input:

1000 50
11 30
4 29
2 26
1 31
3 27
23 29
5 26
4 27
5 28
11 26
2 28
18 27
1 31
8 28
6 25
5 25
14 31
3 27
4 26
16 27
4 31
9 31
6 29
8 27
8 25
3 29
17 27
2 28
9 29
2 31
11 31
12 30
2 30
2 31
19 31
7 26
18 27
9 31
1 27
8 25
8 28
2 27
10 28
7 26
5 31
8 26
12 30
19 31
25 29
2 31
1 31
6 29
4 29
11 27
21 30
...

output:

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

result:

ok ok

Test #9:

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

input:

1000 100
8 28
11 29
9 30
1 28
17 25
20 29
6 26
15 25
1 28
12 30
6 31
10 31
4 27
15 28
4 31
10 25
5 30
4 25
19 31
17 27
5 28
6 31
6 31
3 29
1 29
10 31
9 30
9 31
1 31
10 31
5 28
25 29
15 27
4 31
3 31
18 27
1 31
11 26
4 30
24 29
4 31
1 27
4 25
7 31
2 26
3 31
19 31
1 28
7 25
4 27
9 27
13 26
5 26
12 30
6...

output:

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

result:

ok ok

Test #10:

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

input:

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

output:

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

result:

ok ok

Test #11:

score: -100
Time Limit Exceeded

input:

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

output:


result: