alexjercan/bugnet huggingface dataset:
Problem p02315 test case
Input:
4 5
4 2
5 2
2 1
8 3

Expected output:
13
Problem p02316 test case
Input:
4 8
4 2
5 2
2 1
8 3

Expected output:
21
Problem p02317 test case
Input:
5
5
1
3
2
4

Expected output:
3
Problem p02318 test case
Input:
acac
acm

Expected output:
2
Problem p02319 test case
Input:
4 5
4 2
5 2
2 1
8 3

Expected output:
13
Problem p02320 test case
Input:
4 8
4 3 2
2 1 1
1 2 4
3 2 2

Expected output:
12
Problem p02321 test case
Input:
4 5
4 2
5 2
2 1
8 3

Expected output:
13
Problem p02322 test case
Input:
4 8
4 3 2
2 1 1
1 2 4
3 2 2

Expected output:
12
Problem p02323 test case
Input:
4 6
0 1 2
1 2 3
1 3 9
2 0 1
2 3 6
3 2 4

Expected output:
16
Problem p02324 test case
Input:
4 4
0 1 1
0 2 2
1 3 3
2 3 4

Expected output:
10
Problem p02325 test case
Input:
3
0 0
1 1
2 0

Expected output:
4.82842712
Problem p02326 test case
Input:
4 5
0 0 1 0 0
1 0 0 0 0
0 0 0 1 0
0 0 0 1 0

Expected output:
4
Problem p02327 test case
Input:
4 5
0 0 1 0 0
1 0 0 0 0
0 0 0 1 0
0 0 0 1 0

Expected output:
6
Problem p02328 test case
Input:
8
2 1 3 5 3 4 2 1

Expected output:
12
Problem p02329 test case
Input:
3 14
3 1 2
4 8 2
1 2 3
7 3 2

Expected output:
9
Problem p02330 test case
Input:
2 2 1 9
5 1

Expected output:
1
Problem p02331 test case
Input:
2 3

Expected output:
9
Problem p02332 test case
Input:
2 3

Expected output:
6
Problem p02333 test case
Input:
4 3

Expected output:
36
Problem p02334 test case
Input:
5 3

Expected output:
21
Problem p02335 test case
Input:
3 5

Expected output:
10
Problem p02336 test case
Input:
5 3

Expected output:
6
Problem p02337 test case
Input:
3 5

Expected output:
5
Problem p02338 test case
Input:
5 10

Expected output:
1
Problem p02339 test case
Input:
4 3

Expected output:
6
Problem p02340 test case
Input:
5 3

Expected output:
5
Problem p02341 test case
Input:
5 10

Expected output:
1
Problem p02342 test case
Input:
10 5

Expected output:
7
Problem p02343 test case
Input:
5 12
0 1 4
0 2 3
1 1 2
1 3 4
1 1 4
1 3 2
0 1 3
1 2 4
1 3 0
0 0 4
1 0 2
1 3 0

Expected output:
0
0
1
1
1
0
1
1
Problem p02344 test case
Input:
5 6
0 0 2 5
0 1 2 3
1 0 1
1 1 3
0 1 4 8
1 0 4

Expected output:
2
?
10
Problem p02345 test case
Input:
3 5
0 0 1
0 1 2
0 2 3
1 0 2
1 1 2

Expected output:
1
2
Problem p02346 test case
Input:
3 5
0 1 1
0 2 2
0 3 3
1 1 2
1 2 2

Expected output:
3
2
Problem p02347 test case
Input:
6
2 1
2 2
4 2
6 2
3 3
5 4
2
2 4 0 4
4 10 2 5

Expected output:
0
1
2
4

2
3
5
Problem p02348 test case
Input:
3 5
0 0 1 1
0 1 2 3
0 2 2 2
1 0
1 1

Expected output:
1
3
Problem p02349 test case
Input:
3 5
0 1 2 1
0 2 3 2
0 3 3 3
1 2
1 3

Expected output:
3
5
Problem p02350 test case
Input:
3 5
0 0 1 1
0 1 2 3
0 2 2 2
1 0 2
1 1 2

Expected output:
1
2
Problem p02351 test case
Input:
3 5
0 1 2 1
0 2 3 2
0 3 3 3
1 1 2
1 2 3

Expected output:
4
8
Problem p02352 test case
Input:
6 7
0 1 3 1
0 2 4 -2
1 0 5
1 0 1
0 3 5 3
1 3 4
1 0 5

Expected output:
-2
0
1
-1
Problem p02353 test case
Input:
6 7
0 1 3 1
0 2 4 -2
1 0 5
1 0 1
0 3 5 3
1 3 4
1 0 5

Expected output:
-5
1
6
8
Problem p02354 test case
Input:
6 4
1 2 1 2 3 2

Expected output:
2
Problem p02355 test case
Input:
6 2
4 1 2 1 3 5

Expected output:
2
Problem p02356 test case
Input:
6 5
1 2 3 4 5 6
6 9 12 21 15

Expected output:
9
12
15
21
18
Problem p02357 test case
Input:
7 3
1 7 7 4 8 1 6

Expected output:
1 4 4 1 1
Problem p02358 test case
Input:
2
0 0 3 4
1 2 4 3

Expected output:
13
Problem p02359 test case
Input:
6 10
0 2
1 3
2 6
3 8
4 10
5 10

Expected output:
4
Problem p02360 test case
Input:
2
0 0 3 2
2 1 4 3

Expected output:
2
Problem p02361 test case
Input:
4 5 0
0 1 1
0 2 4
1 2 2
2 3 1
1 3 5

Expected output:
0
1
3
4
Problem p02362 test case
Input:
4 5 0
0 1 2
0 2 3
1 2 -5
1 3 1
2 3 2

Expected output:
0
2
-3
-1
Problem p02363 test case
Input:
4 6
0 1 1
0 2 5
1 2 2
1 3 4
2 3 1
3 2 7

Expected output:
0 1 3 4
INF 0 2 3
INF INF 0 1
INF INF 7 0
Problem p02364 test case
Input:
4 6
0 1 2
1 2 1
2 3 1
3 0 1
0 2 3
1 3 5

Expected output:
3
Problem p02365 test case
Input:
4 6 0
0 1 3
0 2 2
2 0 1
2 3 1
3 0 1
3 1 5

Expected output:
6
Problem p02366 test case
Input:
4 4
0 1
0 2
1 2
2 3

Expected output:
2
Problem p02367 test case
Input:
4 4
0 1
0 2
1 2
2 3

Expected output:
2 3
Problem p02368 test case
Input:
5 6
0 1
1 0
1 2
2 4
4 3
3 2
4
0 1
0 3
2 3
3 4

Expected output:
1
0
1
1
Problem p02369 test case
Input:
3 3
0 1
0 2
1 2

Expected output:
0
Problem p02370 test case
Input:
6 6
0 1
1 2
3 1
3 4
4 5
5 2

Expected output:
0
3
1
4
5
2
Problem p02371 test case
Input:
4
0 1 2
1 2 1
1 3 3

Expected output:
5
Problem p02372 test case
Input:
4
0 1 2
1 2 1
1 3 3

Expected output:
5
3
4
5
Problem p02373 test case
Input:
8
3 1 2 3
2 4 5
0
0
0
2 6 7
0
0
4
4 6
4 7
4 3
5 2

Expected output:
1
1
0
0
Problem p02374 test case
Input:
6
2 1 2
2 3 5
0
0
0
1 4
7
1 1
0 3 10
1 2
0 4 20
1 3
0 5 40
1 4

Expected output:
0
0
10
60
Problem p02375 test case
Input:
6
2 1 2
2 3 5
0
0
0
1 4
7
1 1
0 3 10
1 2
0 4 20
1 3
0 5 40
1 4

Expected output:
0
0
40
150
Problem p02376 test case
Input:
4 5
0 1 2
0 2 1
1 2 1
1 3 1
2 3 2

Expected output:
3
Problem p02377 test case
Input:
4 5 2
0 1 2 1
0 2 1 2
1 2 1 1
1 3 1 3
2 3 2 1

Expected output:
6
Problem p02378 test case
Input:
3 4 6
0 0
0 2
0 3
1 1
2 1
2 3

Expected output:
3
Problem p02379 test case
Input:
0 0 1 1

Expected output:
1.41421356
Problem p02380 test case
Input:
4 3 90

Expected output:
6.00000000
12.00000000
3.00000000
Problem p02381 test case
Input:
5
70 80 100 90 20
3
80 80 80
0

Expected output:
27.85677655
0.00000000
Problem p02382 test case
Input:
3
1 2 3
2 0 4

Expected output:
4.000000
2.449490
2.154435
2.000000
Problem p02383 test case
Input:
1 2 4 8 16 32
SE

Expected output:
8
Problem p02384 test case
Input:
1 2 3 4 5 6
3
6 5
1 3
3 2

Expected output:
3
5
6
Problem p02385 test case
Input:
1 2 3 4 5 6
6 2 4 3 5 1

Expected output:
Yes
Problem p02386 test case
Input:
3
1 2 3 4 5 6
6 2 4 3 5 1
6 5 4 3 2 1

Expected output:
No
Problem p02387 test case
Input:
No input

Expected output:
Hello World
Problem p02388 test case
Input:
2

Expected output:
8
Problem p02389 test case
Input:
3 5

Expected output:
15 16
Problem p02390 test case
Input:
46979

Expected output:
13:2:59
Problem p02391 test case
Input:
1 2

Expected output:
a
Problem p02392 test case
Input:
1 3 8

Expected output:
Yes
Problem p02393 test case
Input:
3 8 1

Expected output:
1 3 8
Problem p02394 test case
Input:
5 4 2 2 1

Expected output:
Yes
Problem p02395 test case
Input:
No input

Expected output:
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
.
.
.
.
.
.
Hello World
Problem p02396 test case
Input:
3
5
11
7
8
19
0

Expected output:
Case 1: 3
Case 2: 5
Case 3: 11
Case 4: 7
Case 5: 8
Case 6: 19
Problem p02397 test case
Input:
3 2
2 2
5 3
0 0

Expected output:
2 3
2 2
3 5
Problem p02398 test case
Input:
5 14 80

Expected output:
3
Problem p02399 test case
Input:
3 2

Expected output:
1 1 1.50000
Problem p02400 test case
Input:
2

Expected output:
12.566371 12.566371
Problem p02401 test case
Input:
1 + 2
56 - 18
13 * 2
100 / 10
27 + 81
0 ? 0

Expected output:
3
38
26
10
108
Problem p02402 test case
Input:
5
10 1 5 4 17

Expected output:
1 17 37
Problem p02403 test case
Input:
3 4
5 6
2 2
0 0

Expected output:
####
####
####

######
######
######
######
######

##
##
Problem p02404 test case
Input:
3 4
5 6
3 3
0 0

Expected output:
####
#..#
####

######
#....#
#....#
#....#
######

###
#.#
###
Problem p02405 test case
Input:
3 4
5 6
3 3
2 2
1 1
0 0

Expected output:
#.#.
.#.#
#.#.

#.#.#.
.#.#.#
#.#.#.
.#.#.#
#.#.#.

#.#
.#.
#.#

#.
.#

#
Problem p02406 test case
Input:
30

Expected output:
 3 6 9 12 13 15 18 21 23 24 27 30
Problem p02407 test case
Input:
5
1 2 3 4 5

Expected output:
5 4 3 2 1
Problem p02408 test case
Input:
47
S 10
S 11
S 12
S 13
H 1
H 2
S 6
S 7
S 8
S 9
H 6
H 8
H 9
H 10
H 11
H 4
H 5
S 2
S 3
S 4
S 5
H 12
H 13
C 1
C 2
D 1
D 2
D 3
D 4
D 5
D 6
D 7
C 3
C 4
C 5
C 6
C 7
C 8
C 9
C 10
C 11
C 13
D 9
D 10
D 11
D 12
D 13

Expected output:
S 1
H 3
H 7
C 12
D 8
Problem p02409 test case
Input:
3
1 1 3 8
3 2 2 7
4 3 8 1

Expected output:
 0 0 8 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 7 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 1 0 0
Problem p02410 test case
Input:
3 4
1 2 0 1
0 3 0 1
4 1 1 0
1
2
3
0

Expected output:
5
6
9
Problem p02411 test case
Input:
40 42 -1
20 30 -1
0 2 -1
-1 -1 -1

Expected output:
A
C
F
Problem p02412 test case
Input:
5 9
0 0

Expected output:
2
Problem p02413 test case
Input:
4 5
1 1 3 4 5
2 2 2 4 5
3 3 0 1 1
2 3 4 4 6

Expected output:
1 1 3 4 5 14
2 2 2 4 5 15
3 3 0 1 1 8
2 3 4 4 6 19
8 9 9 13 17 56
Problem p02414 test case
Input:
3 2 3
1 2
0 3
4 5
1 2 1
0 3 2

Expected output:
1 8 5
0 9 6
4 23 14
Problem p02415 test case
Input:
fAIR, LATER, OCCASIONALLY CLOUDY.

Expected output:
Fair, later, occasionally cloudy.
Problem p02416 test case
Input:
123
55
1000
0

Expected output:
6
10
1
Problem p02417 test case
Input:
This is a pen.

Expected output:
a : 1
b : 0
c : 0
d : 0
e : 1
f : 0
g : 0
h : 1
i : 2
j : 0
k : 0
l : 0
m : 0
n : 1
o : 0
p : 1
q : 0
r : 0
s : 2
t : 1
u : 0
v : 0
w : 0
x : 0
y : 0
z : 0
Problem p02418 test case
Input:
vanceknowledgetoad
advance

Expected output:
Yes
Problem p02419 test case
Input:
computer
Nurtures computer scientists and highly-skilled computer engineers
who will create and exploit "knowledge" for the new era.
Provides an outstanding computer environment.
END_OF_TEXT

Expected output:
3
Problem p02420 test case
Input:
aabc
3
1
2
1
vwxyz
2
3
4
-

Expected output:
aabc
xyzvw
Problem p02421 test case
Input:
3
cat dog
fish fish
lion tiger

Expected output:
1 7
Problem p02422 test case
Input:
abcde
3
replace 1 3 xyz
reverse 0 2
print 1 4

Expected output:
xaze
Problem p02423 test case
Input:
8

Expected output:
00000000000000000000000000001000
11111111111111111111111111110111
00000000000000000000000000010000
00000000000000000000000000000100
Problem p02424 test case
Input:
8 10

Expected output:
00000000000000000000000000001000
00000000000000000000000000001010
00000000000000000000000000000010
Problem p02425 test case
Input:
14
1 0
1 1
1 2
2 1
0 0
0 1
0 2
0 3
3 3
4
5
6
7
8

Expected output:
1
0
1
0
0
1
0
3
13
Problem p02426 test case
Input:
3
3 0 1 3
1 3
3 0 1 2
8
1 0
2 1
3 1
4 2
5 2
6 2
7 2
8 2

Expected output:
0
1
0
2
3
Problem p02427 test case
Input:
4

Expected output:
0:
1: 0
2: 1
3: 0 1
4: 2
5: 0 2
6: 1 2
7: 0 1 2
8: 3
9: 0 3
10: 1 3
11: 0 1 3
12: 2 3
13: 0 2 3
14: 1 2 3
15: 0 1 2 3
Problem p02428 test case
Input:
4
2 0 2

Expected output:
5: 0 2
7: 0 1 2
13: 0 2 3
15: 0 1 2 3
Problem p02429 test case
Input:
4
2 0 2

Expected output:
0:
1: 0
4: 2
5: 0 2
Problem p02430 test case
Input:
5 3

Expected output:
7: 0 1 2
11: 0 1 3
13: 0 2 3
14: 1 2 3
19: 0 1 4
21: 0 2 4
22: 1 2 4
25: 0 3 4
26: 1 3 4
28: 2 3 4
Problem p02431 test case
Input:
8
0 1
0 2
0 3
2
0 4
1 0
1 1
1 2

Expected output:
1
2
4
Problem p02432 test case
Input:
11
0 0 1
0 0 2
0 1 3
1 0
1 1
1 2
2 0
2 1
0 0 4
1 0
1 1

Expected output:
2
1
3
4
1
Problem p02433 test case
Input:
5
0 1
0 2
0 3
1 1
2

Expected output:
3
1
Problem p02434 test case
Input:
3 13
0 0 1
0 0 2
0 0 3
0 1 -1
0 2 4
0 2 5
1 0
1 1
1 2
2 1
1 0
1 1
1 2

Expected output:
1 2 3
-1
4 5
1 2 3

4 5
Problem p02435 test case
Input:
3 9
0 0 1
0 0 2
0 0 3
0 2 4
0 2 5
1 0
1 2
2 0
1 0

Expected output:
3
5
2
Problem p02436 test case
Input:
3 9
0 0 1
0 0 2
0 0 3
0 2 4
0 2 5
1 0
1 2
2 0
1 0

Expected output:
1
4
2
Problem p02437 test case
Input:
2 10
0 0 3
0 0 9
0 0 1
1 0
2 0
1 0
0 0 4
1 0
0 1 8
1 1

Expected output:
9
3
4
8
Problem p02438 test case
Input:
3 10
0 0 1
0 0 2
0 0 3
0 1 4
0 1 5
2 1 0
0 2 6
1 0
1 1
1 2

Expected output:
1 2 3 4 5

6
Problem p02439 test case
Input:
4 5 3

Expected output:
3 5
Problem p02440 test case
Input:
7
8 3 7 1 9 1 4
3
0 0 3
0 1 5
1 0 7

Expected output:
3
1
9
Problem p02441 test case
Input:
9
1 4 1 4 2 1 3 5 6
3
0 9 1
1 6 1
3 7 5

Expected output:
3
2
0
Problem p02442 test case
Input:
3
1 2 3
2
2 4

Expected output:
1
Problem p02443 test case
Input:
8
1 2 3 4 5 6 7 8
2
1 6
3 8

Expected output:
1 6 5 8 7 2 3 4
Problem p02444 test case
Input:
11
1 2 3 4 5 6 7 8 9 10 11
1
2 6 9

Expected output:
1 2 7 8 9 3 4 5 6 10 11
Problem p02445 test case
Input:
11
1 2 3 4 5 6 7 8 9 10 11
1
1 4 7

Expected output:
1 8 9 10 5 6 7 2 3 4 11
Problem p02446 test case
Input:
4
1 2 2 4

Expected output:
1 2 4
Problem p02447 test case
Input:
5
4 7
5 5
2 3
6 8
2 1

Expected output:
2 1
2 3
4 7
5 5
6 8
Problem p02448 test case
Input:
5
105 24 C 1500000000000 white
100 23 C 1500000000000 blue
105 23 A 1480000000000 pink
110 25 B 1500000000000 black
110 20 A 1300000000000 gree

Expected output:
100 23 C 1500000000000 blue
105 23 A 1480000000000 pink
105 24 C 1500000000000 white
110 20 A 1300000000000 gree
110 25 B 1500000000000 black
Problem p02449 test case
Input:
3
2 1 3

Expected output:
1 3 2
2 1 3
2 3 1
Problem p02450 test case
Input:
2

Expected output:
1 2
2 1
Problem p02451 test case
Input:
4
1 2 2 4
3
2
3
5

Expected output:
1
0
0
Problem p02452 test case
Input:
4
1 2 3 4
2
2 4

Expected output:
1
Problem p02453 test case
Input:
4
1 2 2 4
3
2
3
5

Expected output:
1
3
4
Problem p02454 test case
Input:
4
1 2 2 4
3
2
3
5

Expected output:
1 3
3 3
4 4
Problem p02455 test case
Input:
7
0 1
0 2
0 3
0 2
0 4
1 3
1 10

Expected output:
1
2
3
3
4
1
0
Problem p02456 test case
Input:
8
0 1
0 2
0 3
2 2
1 1
1 2
1 3
0 2

Expected output:
1
2
3
1
0
1
3
Problem p02457 test case
Input:
9
0 1
0 2
0 3
2 2
1 1
1 2
1 3
0 4
3 2 4

Expected output:
1
2
3
1
0
1
3
3
4
Problem p02458 test case
Input:
10
0 1
0 1
0 2
0 3
2 2
1 1
1 2
1 3
0 4
3 1 4

Expected output:
1
2
3
4
2
0
1
4
1
1
3
4
Problem p02459 test case
Input:
7
0 blue 4
0 red 1
0 white 5
1 red
1 blue
0 black 8
1 black

Expected output:
1
4
8
Problem p02460 test case
Input:
8
0 blue 4
0 red 1
0 white 5
1 red
1 blue
2 red
1 black
1 red

Expected output:
1
4
0
0
Problem p02461 test case
Input:
9
0 blue 4
0 red 1
0 white 5
1 red
1 blue
2 red
1 black
1 red
3 w z

Expected output:
1
4
0
0
white 5
Problem p02462 test case
Input:
10
0 blue 6
0 red 1
0 blue 4
0 white 5
1 red
1 blue
2 red
1 black
1 red
3 w z

Expected output:
1
6
4
white 5
Problem p02463 test case
Input:
3
1 5 8
2
5 9

Expected output:
1
5
8
9
Problem p02464 test case
Input:
4
1 2 5 8
5
2 3 5 9 11

Expected output:
2
5
Problem p02465 test case
Input:
5
1 2 3 5 8
2
2 5

Expected output:
1
3
8
Problem p02466 test case
Input:
7
1 2 3 4 5 6 7
4
2 4 6 8

Expected output:
1
3
5
7
8
Problem p02467 test case
Input:
12

Expected output:
12: 2 2 3
Problem p02468 test case
Input:
2 3

Expected output:
8
Problem p02469 test case
Input:
3
3 4 6

Expected output:
12
Problem p02470 test case
Input:
6

Expected output:
2
Problem p02471 test case
Input:
4 12

Expected output:
1 0
Problem p02472 test case
Input:
5 8

Expected output:
13
Problem p02473 test case
Input:
5 8

Expected output:
-3
Problem p02474 test case
Input:
5 8

Expected output:
40
Problem p02475 test case
Input:
5 8

Expected output:
0
Problem p02476 test case
Input:
5 8

Expected output:
5
Problem p02477 test case
Input:
5 8

Expected output:
40
Problem p02534 test case
Input:
3

Expected output:
ACLACLACL
Problem p02535 test case
Input:
10 30 20 40

Expected output:
Yes
Problem p02536 test case
Input:
3 1
1 2

Expected output:
1
Problem p02537 test case
Input:
10 3
1
5
4
3
8
6
9
7
2
4

Expected output:
7
Problem p02538 test case
Input:
8 5
3 6 2
1 4 7
3 8 3
2 2 2
4 5 1

Expected output:
11222211
77772211
77333333
72333333
72311333
Problem p02539 test case
Input:
2
1
1
2
3

Expected output:
2
Problem p02540 test case
Input:
4
1 4
2 3
3 1
4 2

Expected output:
1
1
2
2
Problem p02541 test case
Input:
11

Expected output:
10
Problem p02542 test case
Input:
3 3
o..
...
o.#

Expected output:
4
Problem p02543 test case
Input:
5 3
1 2 4 7 8
2
1 5
1 2

Expected output:
4
2
Problem p02544 test case
Input:
3 2
1 2 3

Expected output:
1
Problem p02545 test case
Input:
3
2 3 1 1 3 2 2 1 3
1 2 2 3 1 2 3 1 3

Expected output:
4
Problem p02546 test case
Input:
apple

Expected output:
apples
Problem p02547 test case
Input:
5
1 2
6 6
4 4
3 3
3 2

Expected output:
Yes
Problem p02548 test case
Input:
3

Expected output:
3
Problem p02549 test case
Input:
5 2
1 1
3 4

Expected output:
4
Problem p02550 test case
Input:
6 2 1001

Expected output:
1369
Problem p02551 test case
Input:
5 5
1 3
2 3
1 4
2 2
1 2

Expected output:
1
Problem p02552 test case
Input:
1

Expected output:
0
Problem p02553 test case
Input:
1 2 1 1

Expected output:
2
Problem p02554 test case
Input:
2

Expected output:
2
Problem p02555 test case
Input:
7

Expected output:
3
Problem p02556 test case
Input:
3
1 1
2 4
3 2

Expected output:
4
Problem p02557 test case
Input:
6
1 1 1 2 2 3
1 1 1 2 2 3

Expected output:
Yes
2 2 3 1 1 1
Problem p02558 test case
Input:
4 7
1 0 1
0 0 1
0 2 3
1 0 1
1 1 2
0 0 2
1 1 3

Expected output:
0
1
0
1
Problem p02559 test case
Input:
5 5
1 2 3 4 5
1 0 5
1 2 4
0 3 10
1 0 5
1 0 3

Expected output:
15
7
25
6
Problem p02560 test case
Input:
5
4 10 6 3
6 5 4 3
1 1 0 0
31415 92653 58979 32384
1000000000 1000000000 999999999 999999999

Expected output:
3
13
0
314095480
499999999500000000
Problem p02561 test case
Input:
3 3
#..
..#
...

Expected output:
3
#><
vv#
^^.
Problem p02562 test case
Input:
3 1
5 3 2
1 4 8
7 6 9

Expected output:
19
X..
..X
.X.
Problem p02563 test case
Input:
4 5
1 2 3 4
5 6 7 8 9

Expected output:
5 16 34 60 70 70 59 36
Problem p02564 test case
Input:
6 7
1 4
5 2
3 0
5 5
4 1
0 3
4 2

Expected output:
4
1 5
2 4 1
1 2
2 3 0
Problem p02565 test case
Input:
3 2
1 4
2 5
0 6

Expected output:
Yes
4
2
0
Problem p02566 test case
Input:
abcbcba

Expected output:
21
Problem p02567 test case
Input:
5 5
1 2 3 2 1
2 1 5
3 2 3
1 3 1
2 2 4
3 1 3

Expected output:
3
3
2
6
Problem p02568 test case
Input:
5 7
1 2 3 4 5
1 0 5
0 2 4 100 101
1 0 3
0 1 3 102 103
1 2 5
0 2 5 104 105
1 0 5

Expected output:
15
404
41511
4317767
Problem p02569 test case
Input:
5 5
0 1 0 0 1
2 1 5
1 3 4
2 2 5
1 1 3
2 1 2

Expected output:
2
0
1
Problem p02570 test case
Input:
1000 15 80

Expected output:
Yes
Problem p02571 test case
Input:
cabacc
abc

Expected output:
1
Problem p02572 test case
Input:
3
1 2 3

Expected output:
11
Problem p02573 test case
Input:
5 3
1 2
3 4
5 1

Expected output:
3
Problem p02574 test case
Input:
3
3 4 5

Expected output:
pairwise coprime
Problem p02575 test case
Input:
4 4
2 4
1 1
2 3
2 4

Expected output:
1
3
6
-1
Problem p02576 test case
Input:
20 12 6

Expected output:
12
Problem p02577 test case
Input:
123456789

Expected output:
Yes
Problem p02578 test case
Input:
5
2 1 5 4 3

Expected output:
4
Problem p02579 test case
Input:
4 4
1 1
4 4
..#.
..#.
.#..
.#..

Expected output:
1
Problem p02580 test case
Input:
2 3 3
2 2
1 1
1 3

Expected output:
3
Problem p02581 test case
Input:
2
1 2 1 2 2 1

Expected output:
2
Problem p02582 test case
Input:
RRS

Expected output:
2
Problem p02583 test case
Input:
5
4 4 9 7 5

Expected output:
5
Problem p02584 test case
Input:
6 2 4

Expected output:
2
Problem p02585 test case
Input:
5 2
2 4 5 1 3
3 4 -10 -8 8

Expected output:
8
Problem p02586 test case
Input:
2 2 3
1 1 3
2 1 4
1 2 5

Expected output:
8
Problem p02587 test case
Input:
3
ba 3
abc 4
cbaa 5

Expected output:
7
Problem p02588 test case
Input:
5
7.5
2.4
17.000000001
17
16.000000000

Expected output:
3
Problem p02589 test case
Input:
3
abcxyx
cyx
abc

Expected output:
1
Problem p02590 test case
Input:
4
2019 0 2020 200002

Expected output:
474287
Problem p02591 test case
Input:
3
2 3 1 4

Expected output:
121788
Problem p02593 test case
Input:
6
1 8
6 10
2 7
4 4
9 3
5 1

Expected output:
5
0
7
5
0
0
Problem p02594 test case
Input:
25

Expected output:
No
Problem p02595 test case
Input:
4 5
0 5
-2 4
3 4
4 -4

Expected output:
3
Problem p02596 test case
Input:
101

Expected output:
4
Problem p02597 test case
Input:
4
WWRR

Expected output:
2
Problem p02598 test case
Input:
2 3
7 9

Expected output:
4
Problem p02599 test case
Input:
4 3
1 2 1 3
1 3
2 4
3 3

Expected output:
2
3
1
Problem p02600 test case
Input:
725

Expected output:
7
Problem p02601 test case
Input:
7 2 5
3

Expected output:
Yes
Problem p02602 test case
Input:
5 3
96 98 95 100 20

Expected output:
Yes
No
Problem p02603 test case
Input:
7
100 130 130 130 115 115 150

Expected output:
1685
Problem p02604 test case
Input:
3
1 2 300
3 3 600
1 4 800

Expected output:
2900
900
0
0
Problem p02605 test case
Input:
2
11 1 U
11 47 D

Expected output:
230
Problem p02606 test case
Input:
5 10 2

Expected output:
3
Problem p02607 test case
Input:
5
1 3 4 5 7

Expected output:
2
Problem p02608 test case
Input:
20

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
Problem p02609 test case
Input:
3
011

Expected output:
2
1
1
Problem p02610 test case
Input:
3
2
1 5 10
2 15 5
3
2 93 78
1 71 59
3 57 96
19
19 23 16
5 90 13
12 85 70
19 67 78
12 16 60
18 48 28
5 4 24
12 97 97
4 57 87
19 91 74
18 100 76
7 86 46
9 100 57
3 76 73
6 84 93
1 6 84
11 75 94
19 15 3
12 11 34

Expected output:
25
221
1354
Problem p02611 test case
Input:
4
4
6
10
1000000000

Expected output:
0
11
4598
257255556
Problem p02612 test case
Input:
1900

Expected output:
100
Problem p02613 test case
Input:
6
AC
TLE
AC
AC
WA
TLE

Expected output:
AC x 3
WA x 1
TLE x 2
RE x 0
Problem p02614 test case
Input:
2 3 2
..#
###

Expected output:
5
Problem p02615 test case
Input:
4
2 2 1 3

Expected output:
7
Problem p02616 test case
Input:
4 2
1 2 -3 -4

Expected output:
12
Problem p02617 test case
Input:
3
1 3
2 3

Expected output:
7
Problem p02618 test case
Input:
5
86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 82
19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424
6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 10711 4917 10770 17272 15364 19277 18094 3929 3705 7169 6159 18683 15410 9092 4570
6878 4239 19925 1799 375 9563 3445 5658 19857 11401 6997 6498 19933 3848 2426 2146 19745 16880 17773 18359 3921 14172 16730 11157 5439 256
8633 15862 15303 10749 18499 7792 10317 5901 9395 11433 3514 3959 5202 19850 19469 9790 5653 784 18500 10552 17975 16615 7852 197 8471 7452
19855 17918 7990 10572 4333 438 9140 9104 12622 4985 12319 4028 19922 12132 16259 17476 2976 547 19195 19830 16285 4806 4471 9457 2864 2192

Expected output:
1
17
13
14
13
Problem p02619 test case
Input:
5
86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 82
19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424
6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 10711 4917 10770 17272 15364 19277 18094 3929 3705 7169 6159 18683 15410 9092 4570
6878 4239 19925 1799 375 9563 3445 5658 19857 11401 6997 6498 19933 3848 2426 2146 19745 16880 17773 18359 3921 14172 16730 11157 5439 256
8633 15862 15303 10749 18499 7792 10317 5901 9395 11433 3514 3959 5202 19850 19469 9790 5653 784 18500 10552 17975 16615 7852 197 8471 7452
19855 17918 7990 10572 4333 438 9140 9104 12622 4985 12319 4028 19922 12132 16259 17476 2976 547 19195 19830 16285 4806 4471 9457 2864 2192
1
17
13
14
13

Expected output:
18398
35037
51140
65837
79325
Problem p02620 test case
Input:
5
86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 82
19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424
6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 10711 4917 10770 17272 15364 19277 18094 3929 3705 7169 6159 18683 15410 9092 4570
6878 4239 19925 1799 375 9563 3445 5658 19857 11401 6997 6498 19933 3848 2426 2146 19745 16880 17773 18359 3921 14172 16730 11157 5439 256
8633 15862 15303 10749 18499 7792 10317 5901 9395 11433 3514 3959 5202 19850 19469 9790 5653 784 18500 10552 17975 16615 7852 197 8471 7452
19855 17918 7990 10572 4333 438 9140 9104 12622 4985 12319 4028 19922 12132 16259 17476 2976 547 19195 19830 16285 4806 4471 9457 2864 2192
1
17
13
14
13
5
1 7
4 11
3 4
5 24
4 19

Expected output:
72882
56634
38425
27930
42884
Problem p02621 test case
Input:
2

Expected output:
14
Problem p02622 test case
Input:
cupofcoffee
cupofhottea

Expected output:
4