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

Expected output:
2
Problem p03355 test case
Input:
aba
4

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

Expected output:
2
Problem p03357 test case
Input:
3
B 1
W 2
B 3
W 1
W 3
B 2

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

Expected output:
5
Problem p03359 test case
Input:
5 5

Expected output:
5
Problem p03360 test case
Input:
5 3 11
1

Expected output:
30
Problem p03361 test case
Input:
3 3
.#.
###
.#.

Expected output:
Yes
Problem p03362 test case
Input:
5

Expected output:
3 5 7 11 31
Problem p03363 test case
Input:
6
1 3 -4 2 2 -2

Expected output:
3
Problem p03364 test case
Input:
2
ab
ca

Expected output:
2
Problem p03365 test case
Input:
4

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

Expected output:
4
Problem p03367 test case
Input:
3
2 3 3

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

Expected output:
4
Problem p03369 test case
Input:
oxo

Expected output:
900
Problem p03370 test case
Input:
3 1000
120
100
140

Expected output:
9
Problem p03371 test case
Input:
1500 2000 1600 3 2

Expected output:
7900
Problem p03372 test case
Input:
3 20
2 80
9 120
16 1

Expected output:
191
Problem p03373 test case
Input:
1500 2000 1600 3 2

Expected output:
7900
Problem p03374 test case
Input:
3 20
2 80
9 120
16 1

Expected output:
191
Problem p03375 test case
Input:
2 1000000007

Expected output:
2
Problem p03376 test case
Input:
3 100 1
15
10 1
20 1

Expected output:
7
Problem p03377 test case
Input:
3 5 4

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

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

Expected output:
4
3
3
4
Problem p03380 test case
Input:
5
6 9 4 2 11

Expected output:
11 6
Problem p03381 test case
Input:
4
2 4 4 3

Expected output:
4
3
3
4
Problem p03382 test case
Input:
5
6 9 4 2 11

Expected output:
11 6
Problem p03383 test case
Input:
2 3
arc
rac

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

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

Expected output:
Yes
Problem p03386 test case
Input:
3 8 2

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

Expected output:
2
Problem p03388 test case
Input:
8
1 4
10 5
3 3
4 11
8 9
22 40
8 36
314159265 358979323

Expected output:
1
12
4
11
14
57
31
671644785
Problem p03389 test case
Input:
2 5 4

Expected output:
2
Problem p03390 test case
Input:
8
1 4
10 5
3 3
4 11
8 9
22 40
8 36
314159265 358979323

Expected output:
1
12
4
11
14
57
31
671644785
Problem p03391 test case
Input:
2
1 2
3 2

Expected output:
2
Problem p03392 test case
Input:
abc

Expected output:
3
Problem p03393 test case
Input:
atcoder

Expected output:
atcoderb
Problem p03394 test case
Input:
3

Expected output:
2 5 63
Problem p03395 test case
Input:
3
19 10 14
0 3 4

Expected output:
160
Problem p03396 test case
Input:
2 10
5 8
10 4

Expected output:
40
Problem p03397 test case
Input:
1??00

Expected output:
2
Problem p03398 test case
Input:
3

Expected output:
12
Problem p03399 test case
Input:
600
300
220
420

Expected output:
520
Problem p03400 test case
Input:
3
7 1
2
5
10

Expected output:
8
Problem p03401 test case
Input:
3
3 5 -1

Expected output:
12
8
10
Problem p03402 test case
Input:
2 3

Expected output:
3 3
##.
..#
#.#
Problem p03403 test case
Input:
3
3 5 -1

Expected output:
12
8
10
Problem p03404 test case
Input:
2 3

Expected output:
3 3
##.
..#
#.#
Problem p03405 test case
Input:
3 3
2
1 2 1
2 3 1
3 1 1

Expected output:
6
Problem p03406 test case
Input:
2 1
3

Expected output:
8
Problem p03407 test case
Input:
50 100 120

Expected output:
Yes
Problem p03408 test case
Input:
3
apple
orange
apple
1
grape

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

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

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

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

Expected output:
same
diff
same
Problem p03415 test case
Input:
ant
obe
rec

Expected output:
abc
Problem p03416 test case
Input:
11009 11332

Expected output:
4
Problem p03417 test case
Input:
2 2

Expected output:
0
Problem p03418 test case
Input:
5 2

Expected output:
7
Problem p03419 test case
Input:
2 2

Expected output:
0
Problem p03420 test case
Input:
5 2

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

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

Expected output:
Aoki
Problem p03423 test case
Input:
8

Expected output:
2
Problem p03424 test case
Input:
6
G W Y P Y W

Expected output:
Four
Problem p03425 test case
Input:
5
MASHIKE
RUMOI
OBIRA
HABORO
HOROKANAI

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

Expected output:
5
Problem p03427 test case
Input:
100

Expected output:
18
Problem p03428 test case
Input:
2
0 0
1 1

Expected output:
0.5
0.5
Problem p03429 test case
Input:
3 4 4 2

Expected output:
YES
<><>
^<>^
v<>v
Problem p03430 test case
Input:
abcabcabc
1

Expected output:
7
Problem p03431 test case
Input:
2 4

Expected output:
7
Problem p03432 test case
Input:
2 3

Expected output:
64
Problem p03433 test case
Input:
2018
218

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

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

Expected output:
Yes
Problem p03436 test case
Input:
3 3
..#
#..
...

Expected output:
2
Problem p03437 test case
Input:
8 6

Expected output:
16
Problem p03438 test case
Input:
3
1 2 3
5 2 2

Expected output:
Yes
Problem p03440 test case
Input:
7 5
1 2 3 4 5 6 7
3 0
4 0
1 2
1 3
5 6

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

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

Expected output:
3
Problem p03443 test case
Input:
2
010

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

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

Expected output:
20
Problem p03446 test case
Input:
1 1 1 2 2 2

Expected output:
1
Problem p03447 test case
Input:
1234
150
100

Expected output:
84
Problem p03448 test case
Input:
2
2
2
100

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

Expected output:
14
Problem p03450 test case
Input:
3 3
1 2 1
2 3 1
1 3 2

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

Expected output:
14
Problem p03452 test case
Input:
3 3
1 2 1
2 3 1
1 3 2

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

Expected output:
2
Problem p03454 test case
Input:
1

Expected output:
9
Problem p03455 test case
Input:
3 4

Expected output:
Even
Problem p03456 test case
Input:
1 21

Expected output:
Yes
Problem p03457 test case
Input:
2
3 1 2
6 1 1

Expected output:
Yes
Problem p03458 test case
Input:
4 3
0 1 W
1 2 W
5 3 B
5 4 B

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

Expected output:
Yes
Problem p03460 test case
Input:
4 3
0 1 W
1 2 W
5 3 B
5 4 B

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

Expected output:
Possible
3 4
1 2 X
2 3 1
3 2 Y
1 3 Y
1 3
Problem p03462 test case
Input:
2 2
rb

Expected output:
9
Problem p03463 test case
Input:
5 2 4

Expected output:
Alice
Problem p03464 test case
Input:
4
3 4 3 2

Expected output:
6 8
Problem p03465 test case
Input:
3
1 2 1

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

Expected output:
BABAB
AABAABAABB
A
BAABA
ABAB
Problem p03467 test case
Input:
011

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

Expected output:
0.3333333333333333
Problem p03469 test case
Input:
2017/01/07

Expected output:
2018/01/07
Problem p03470 test case
Input:
4
10
8
8
6

Expected output:
3
Problem p03471 test case
Input:
9 45000

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

Expected output:
3
Problem p03473 test case
Input:
21

Expected output:
27
Problem p03474 test case
Input:
3 4
269-6650

Expected output:
Yes
Problem p03475 test case
Input:
3
6 5 1
1 10 1

Expected output:
12
11
0
Problem p03476 test case
Input:
1
3 7

Expected output:
2
Problem p03477 test case
Input:
3 8 7 1

Expected output:
Left
Problem p03478 test case
Input:
20 2 5

Expected output:
84
Problem p03479 test case
Input:
3 20

Expected output:
3
Problem p03480 test case
Input:
010

Expected output:
2
Problem p03481 test case
Input:
3 20

Expected output:
3
Problem p03482 test case
Input:
010

Expected output:
2
Problem p03483 test case
Input:
eel

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

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

Expected output:
2
Problem p03486 test case
Input:
yx
axy

Expected output:
Yes
Problem p03487 test case
Input:
4
3 3 3 3

Expected output:
1
Problem p03488 test case
Input:
FTFFTFFF
4 2

Expected output:
Yes
Problem p03489 test case
Input:
4
3 3 3 3

Expected output:
1
Problem p03490 test case
Input:
FTFFTFFF
4 2

Expected output:
Yes
Problem p03491 test case
Input:
2 2
00
01

Expected output:
Alice
Problem p03492 test case
Input:
3
1 2
2 3

Expected output:
3
Problem p03493 test case
Input:
101

Expected output:
2
Problem p03494 test case
Input:
3
8 12 40

Expected output:
2
Problem p03495 test case
Input:
5 2
1 1 2 2 5

Expected output:
1
Problem p03496 test case
Input:
3
-2 5 -1

Expected output:
2
2 3
3 3
Problem p03497 test case
Input:
5 2
1 1 2 2 5

Expected output:
1
Problem p03498 test case
Input:
3
-2 5 -1

Expected output:
2
2 3
3 3
Problem p03499 test case
Input:
2
0 0

Expected output:
8
Problem p03500 test case
Input:
2 2
5 7

Expected output:
6
Problem p03501 test case
Input:
7 17 120

Expected output:
119
Problem p03502 test case
Input:
12

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

Expected output:
8
Problem p03504 test case
Input:
3 2
1 7 2
7 8 1
8 12 1

Expected output:
2
Problem p03505 test case
Input:
4000 2000 500

Expected output:
5
Problem p03506 test case
Input:
3 3
5 7
8 11
3 9

Expected output:
2
1
3
Problem p03507 test case
Input:
2 6
20 10
25 15

Expected output:
50
Problem p03508 test case
Input:
4 1
1 3

Expected output:
2
Problem p03509 test case
Input:
4 75
1 1
1 1
1 1
1 1

Expected output:
3
Problem p03510 test case
Input:
5
10 20
40 50
60 30
70 40
90 10

Expected output:
90
Problem p03511 test case
Input:
6
at
code

Expected output:
atatat
Problem p03512 test case
Input:
3
2 10
3 -20
6 15

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

Expected output:
6
Problem p03514 test case
Input:
1
150000
108

Expected output:
150000.0
Problem p03515 test case
Input:
3
1 2 10
2 3 20

Expected output:
20
30
30
Problem p03516 test case
Input:
5
1 2 2 3 2

Expected output:
6
Problem p03517 test case
Input:
4 3 3
1 0 1 2
1 2 10
2 3 20
2 4 50

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

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

Expected output:
15
15
Problem p03520 test case
Input:
4
1 2
2 3
3 4
8 6 6 8

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

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

Expected output:
2
Problem p03523 test case
Input:
KIHBR

Expected output:
YES
Problem p03524 test case
Input:
abac

Expected output:
YES
Problem p03525 test case
Input:
3
7 12 8

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

Expected output:
2
Problem p03527 test case
Input:
bixzja
2
2 3
3 6

Expected output:
YES
Problem p03529 test case
Input:
2 2

Expected output:
10
Problem p03530 test case
Input:
3 3
+#+
#P#
+#+

Expected output:
2
Problem p03531 test case
Input:
3
0 3 0 6 0 0 0 8

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

Expected output:
22
Problem p03533 test case
Input:
KIHBR

Expected output:
YES
Problem p03534 test case
Input:
abac

Expected output:
YES
Problem p03535 test case
Input:
3
7 12 8

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

Expected output:
2
Problem p03537 test case
Input:
bixzja
2
2 3
3 6

Expected output:
YES
Problem p03539 test case
Input:
2 2

Expected output:
10
Problem p03540 test case
Input:
3 3
+#+
#P#
+#+

Expected output:
2
Problem p03541 test case
Input:
3
0 3 0 6 0 0 0 8

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

Expected output:
22
Problem p03543 test case
Input:
1118

Expected output:
Yes
Problem p03544 test case
Input:
5

Expected output:
11
Problem p03545 test case
Input:
1222

Expected output:
1+2+2+2=7
Problem p03546 test case
Input:
2 4
0 9 9 9 9 9 9 9 9 9
9 0 9 9 9 9 9 9 9 9
9 9 0 9 9 9 9 9 9 9
9 9 9 0 9 9 9 9 9 9
9 9 9 9 0 9 9 9 9 2
9 9 9 9 9 0 9 9 9 9
9 9 9 9 9 9 0 9 9 9
9 9 9 9 9 9 9 0 9 9
9 9 9 9 2 9 9 9 0 9
9 2 9 9 9 9 9 9 9 0
-1 -1 -1 -1
8 1 1 8

Expected output:
12
Problem p03547 test case
Input:
A B

Expected output:
<
Problem p03548 test case
Input:
13 3 1

Expected output:
3
Problem p03549 test case
Input:
1 1

Expected output:
3800
Problem p03550 test case
Input:
3 100 100
10 1000 100

Expected output:
900
Problem p03551 test case
Input:
1 1

Expected output:
3800
Problem p03552 test case
Input:
3 100 100
10 1000 100

Expected output:
900
Problem p03553 test case
Input:
6
1 2 -6 4 5 3

Expected output:
12
Problem p03554 test case
Input:
3
1 0 1
1
1 3

Expected output:
1
Problem p03555 test case
Input:
pot
top

Expected output:
YES
Problem p03556 test case
Input:
10

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

Expected output:
3
Problem p03558 test case
Input:
6

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

Expected output:
3
Problem p03560 test case
Input:
6

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

Expected output:
2 1
Problem p03562 test case
Input:
3 111
1111
10111
10010

Expected output:
4
Problem p03563 test case
Input:
2002
2017

Expected output:
2032
Problem p03564 test case
Input:
4
3

Expected output:
10
Problem p03565 test case
Input:
?tc????
coder

Expected output:
atcoder
Problem p03566 test case
Input:
1
100
30

Expected output:
2100.000000000000000
Problem p03567 test case
Input:
BACD

Expected output:
Yes
Problem p03568 test case
Input:
2
2 3

Expected output:
7
Problem p03569 test case
Input:
xabxa

Expected output:
2
Problem p03570 test case
Input:
aabxyyzz

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

Expected output:
54
Problem p03572 test case
Input:
3
1 2 3
2 3 1

Expected output:
2
Problem p03573 test case
Input:
5 7 5

Expected output:
7
Problem p03574 test case
Input:
3 5
.....
.#.#.
.....

Expected output:
11211
1#2#1
11211
Problem p03575 test case
Input:
7 7
1 3
2 7
3 4
4 5
4 6
5 6
6 7

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

Expected output:
21
Problem p03577 test case
Input:
CODEFESTIVAL

Expected output:
CODE
Problem p03578 test case
Input:
5
3 1 4 1 5
3
5 4 3

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

Expected output:
4
Problem p03580 test case
Input:
7
1010101

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

Expected output:
20
Problem p03582 test case
Input:
2 2 0

Expected output:
abab
Problem p03583 test case
Input:
2

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

Expected output:
8
Problem p03585 test case
Input:
3
1 1 1
2 -1 2
-1 2 2

Expected output:
1.000000000000000 1.000000000000000
Problem p03586 test case
Input:
4
2 4
3 8
9 6
10 7

Expected output:
4
11
9
2
Problem p03587 test case
Input:
111100

Expected output:
4
Problem p03588 test case
Input:
3
4 7
2 9
6 2

Expected output:
8
Problem p03589 test case
Input:
2

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

Expected output:
8
Problem p03591 test case
Input:
YAKINIKU

Expected output:
Yes
Problem p03592 test case
Input:
2 2 2

Expected output:
Yes
Problem p03593 test case
Input:
3 4
aabb
aabb
aacc

Expected output:
Yes
Problem p03594 test case
Input:
2 2 1

Expected output:
RY
GR
Problem p03595 test case
Input:
2 2
10
01
10
01

Expected output:
6
Problem p03596 test case
Input:
2
3 3

Expected output:
2
Problem p03597 test case
Input:
3
4

Expected output:
5
Problem p03598 test case
Input:
1
10
2

Expected output:
4
Problem p03599 test case
Input:
1 2 10 20 15 200

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

Expected output:
3
Problem p03601 test case
Input:
1 2 10 20 15 200

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

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

Expected output:
POSSIBLE
Problem p03604 test case
Input:
2
1 1
1 2
2 1
2 2

Expected output:
8
Problem p03605 test case
Input:
29

Expected output:
Yes
Problem p03606 test case
Input:
1
24 30

Expected output:
7
Problem p03607 test case
Input:
3
6
2
6

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

Expected output:
2
Problem p03609 test case
Input:
100 17

Expected output:
83
Problem p03610 test case
Input:
atcoder

Expected output:
acdr
Problem p03611 test case
Input:
7
3 1 4 1 5 9 2

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

Expected output:
2
Problem p03613 test case
Input:
7
3 1 4 1 5 9 2

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

Expected output:
2
Problem p03615 test case
Input:
4
0 0
0 1
1 0
1 1

Expected output:
5
Problem p03616 test case
Input:
180
3
60 120 180
3
30 90
61 1
180 180

Expected output:
60
1
120
Problem p03617 test case
Input:
20 30 70 90
3

Expected output:
150
Problem p03618 test case
Input:
aatt

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

Expected output:
891.415926535897938
Problem p03620 test case
Input:
1010
1100

Expected output:
3
Problem p03621 test case
Input:
1010
1100

Expected output:
3
Problem p03622 test case
Input:
1 1

Expected output:
499122178
Problem p03623 test case
Input:
5 2 7

Expected output:
B
Problem p03624 test case
Input:
atcoderregularcontest

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

Expected output:
2
Problem p03626 test case
Input:
3
aab
ccb

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

Expected output:
2
Problem p03628 test case
Input:
3
aab
ccb

Expected output:
6
Problem p03629 test case
Input:
atcoderregularcontest

Expected output:
b
Problem p03630 test case
Input:
3 3
..#
##.
.#.

Expected output:
6
Problem p03631 test case
Input:
575

Expected output:
Yes
Problem p03632 test case
Input:
0 75 25 100

Expected output:
50
Problem p03633 test case
Input:
2
2
3

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

Expected output:
3
2
4
Problem p03635 test case
Input:
3 4

Expected output:
6
Problem p03636 test case
Input:
internationalization

Expected output:
i18n
Problem p03637 test case
Input:
3
1 10 100

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

Expected output:
1 1
2 3
Problem p03639 test case
Input:
3
1 10 100

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

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

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

Expected output:
2
Problem p03643 test case
Input:
100

Expected output:
ABC100
Problem p03644 test case
Input:
7

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

Expected output:
POSSIBLE
Problem p03646 test case
Input:
0

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

Expected output:
POSSIBLE
Problem p03648 test case
Input:
0

Expected output:
4
3 3 3 3
Problem p03649 test case
Input:
4
3 3 3 3

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

Expected output:
POSSIBLE
Problem p03651 test case
Input:
3 7
9 3 4

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

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

Expected output:
18
Problem p03654 test case
Input:
5
1 2 5
3 4 7
2 3 3
2 5 2

Expected output:
38
Problem p03655 test case
Input:
1 1 2 2 3 4
1 1 2 2 3 3

Expected output:
10
Problem p03656 test case
Input:
5
3 3 4 -1 4
4 4 1 -1 1

Expected output:
POSSIBLE
1 -1 -1 3 -1
Problem p03657 test case
Input:
4 5

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

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

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

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

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

Expected output:
Fennec
Problem p03664 test case
Input:
4 6
1 2 100
3 1 100
2 4 100
4 3 100
1 4 100
3 2 100

Expected output:
200
Problem p03665 test case
Input:
2 0
1 3

Expected output:
2
Problem p03666 test case
Input:
5 1 5 2 4

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

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

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

Expected output:
YES
Problem p03670 test case
Input:
3 2 1
1 2 0

Expected output:
6
Problem p03671 test case
Input:
700 600 780

Expected output:
1300
Problem p03672 test case
Input:
abaababaab

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

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

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

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

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

Expected output:
5
Problem p03678 test case
Input:
abaaba
6 10

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

Expected output:
safe
Problem p03680 test case
Input:
3
3
1
2

Expected output:
2
Problem p03681 test case
Input:
2 2

Expected output:
8
Problem p03682 test case
Input:
3
1 5
3 9
7 8

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

Expected output:
8
Problem p03684 test case
Input:
3
1 5
3 9
7 8

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

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

Expected output:
0
Problem p03687 test case
Input:
serval

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

Expected output:
Yes
Problem p03689 test case
Input:
3 3 2 2

Expected output:
Yes
1 1 1
1 -4 1
1 1 1
Problem p03690 test case
Input:
3
0 1 2
3 1 0

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

Expected output:
2
Problem p03692 test case
Input:
2 1
1 2

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

Expected output:
YES
Problem p03694 test case
Input:
4
2 3 7 9

Expected output:
7
Problem p03695 test case
Input:
4
2100 2500 2700 2700

Expected output:
2 2
Problem p03696 test case
Input:
3
())

Expected output:
(())
Problem p03697 test case
Input:
6 3

Expected output:
9
Problem p03698 test case
Input:
uncopyrightable

Expected output:
yes
Problem p03699 test case
Input:
3
5
10
15

Expected output:
25
Problem p03700 test case
Input:
4 5 3
8
7
4
2

Expected output:
2
Problem p03701 test case
Input:
3
5
10
15

Expected output:
25
Problem p03702 test case
Input:
4 5 3
8
7
4
2

Expected output:
2
Problem p03703 test case
Input:
3 6
7
5
7

Expected output:
5
Problem p03704 test case
Input:
63

Expected output:
2
Problem p03705 test case
Input:
4 4 6

Expected output:
5
Problem p03706 test case
Input:
UUD

Expected output:
7
Problem p03707 test case
Input:
3 4 4
1101
0110
1101
1 1 3 4
1 1 3 1
2 2 3 4
1 2 2 4

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

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

Expected output:
6
Problem p03710 test case
Input:
3
4 4
6 10
12 11

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

Expected output:
Yes
Problem p03712 test case
Input:
2 3
abc
arc

Expected output:
#####
#abc#
#arc#
#####
Problem p03713 test case
Input:
3 5

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

Expected output:
1
Problem p03715 test case
Input:
3 5

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

Expected output:
1