Server Time：

20.0% (4/20)

4.8% (4/84)

# Sample Input 1

8 3
-1 1 -1 -1 1 -1 -1 1
2 5
2 8
1 8

-3 0
-1 0
0 0

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

-1 8
-1 2
-2 7
-7 2

# Hints

1. $(-1, -1, -1, +1)$
2. $(-1)$
3. $()$

1. $h = 0 \overset{-1}{\longrightarrow} -1 \overset{-1}{\longrightarrow} -2 \overset{-1}{\longrightarrow} -3 \overset{+1}{\longrightarrow} -2$
2. $h = 0 \overset{-1}{\longrightarrow} -1$
3. $h = 0$

# Problem Source

CODEFORCES 1473D Program

No. Testdata Range Score
1 0~24 100

# Testdata and Limits

No. Time Limit (ms) Memory Limit (KiB) Output Limit (KiB) Subtasks
0 1000 65536 65536 1
1 1000 65536 65536 1
2 1000 65536 65536 1
3 1000 65536 65536 1
4 1000 65536 65536 1
5 1000 65536 65536 1
6 1000 65536 65536 1
7 1000 65536 65536 1
8 1000 65536 65536 1
9 1000 65536 65536 1
10 1000 65536 65536 1
11 1000 65536 65536 1
12 1000 65536 65536 1
13 1000 65536 65536 1
14 1000 65536 65536 1
15 1000 65536 65536 1
16 1000 65536 65536 1
17 1000 65536 65536 1
18 1000 65536 65536 1
19 1000 65536 65536 1
20 1000 65536 65536 1
21 1000 65536 65536 1
22 1000 65536 65536 1
23 1000 65536 65536 1
24 1000 65536 65536 1