alexjercan/bugnet huggingface dataset:
Problem p03717 test case
Input:
3 1
1 3 3

Expected output:
6
Problem p03718 test case
Input:
3 3
S.o
.o.
o.T

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

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

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

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

Expected output:
7
Problem p03723 test case
Input:
4 12 20

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

Expected output:
YES
Problem p03725 test case
Input:
3 3 3
#.#
#S.
###

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

Expected output:
First
Problem p03727 test case
Input:
3
1 2
2 3
1 3
3 2

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

Expected output:
3
Problem p03729 test case
Input:
rng gorilla apple

Expected output:
YES
Problem p03730 test case
Input:
7 5 1

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

Expected output:
7
Problem p03732 test case
Input:
4 6
2 1
3 4
4 10
3 4

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

Expected output:
7
Problem p03734 test case
Input:
4 6
2 1
3 4
4 10
3 4

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

Expected output:
15
Problem p03736 test case
Input:
8 3 1 8
3 5 1

Expected output:
7
Problem p03737 test case
Input:
atcoder beginner contest

Expected output:
ABC
Problem p03738 test case
Input:
36
24

Expected output:
GREATER
Problem p03739 test case
Input:
4
1 -3 1 0

Expected output:
4
Problem p03740 test case
Input:
2 1

Expected output:
Brown
Problem p03741 test case
Input:
4
1 -3 1 0

Expected output:
4
Problem p03742 test case
Input:
2 1

Expected output:
Brown
Problem p03743 test case
Input:
4 10
3 4 3 3
2
4 3

Expected output:
NO
YES
Problem p03744 test case
Input:
3 10
10 10
20 5
4 3

Expected output:
10.0000000
15.0000000
13.2000000
Problem p03745 test case
Input:
6
1 2 3 2 2 1

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

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

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

Expected output:
56
Problem p03749 test case
Input:
3 1
2

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

Expected output:
0
1
2
Problem p03751 test case
Input:
2
tourist
petr
e

Expected output:
1
Problem p03752 test case
Input:
5 5
3949 3774 3598 3469 3424

Expected output:
1541
Problem p03753 test case
Input:
7 7 3
1 3 5

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

Expected output:
2.0
1.0
2.0
2.0
Problem p03755 test case
Input:
7 2 3
0 7

Expected output:
55
Problem p03756 test case
Input:
4 4 2 2
1 1 2 2
1 1 E 1 1
1 2 E 2 2

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

Expected output:
15
12
30
8
Problem p03759 test case
Input:
2 4 6

Expected output:
YES
Problem p03760 test case
Input:
xyz
abc

Expected output:
xaybzc
Problem p03761 test case
Input:
3
cbaa
daacc
acacac

Expected output:
aac
Problem p03762 test case
Input:
3 3
1 3 4
1 3 6

Expected output:
60
Problem p03763 test case
Input:
3
cbaa
daacc
acacac

Expected output:
aac
Problem p03764 test case
Input:
3 3
1 3 4
1 3 6

Expected output:
60
Problem p03765 test case
Input:
BBBAAAABA
BBBBA
4
7 9 2 5
7 9 1 4
1 7 2 5
1 7 2 4

Expected output:
YES
NO
YES
NO
Problem p03766 test case
Input:
2

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

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

Expected output:
2
2
2
2
2
1
0
Problem p03769 test case
Input:
7

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

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

Expected output:
Possible
Possible
Possible
Problem p03772 test case
Input:
2
1 3 2

Expected output:
3
Problem p03773 test case
Input:
9 12

Expected output:
21
Problem p03774 test case
Input:
2 2
2 0
0 0
-1 0
1 0

Expected output:
2
1
Problem p03775 test case
Input:
10000

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

Expected output:
4.500000
1
Problem p03777 test case
Input:
H H

Expected output:
H
Problem p03778 test case
Input:
3 2 6

Expected output:
1
Problem p03779 test case
Input:
6

Expected output:
3
Problem p03780 test case
Input:
3 6
1 4 3

Expected output:
1
Problem p03781 test case
Input:
6

Expected output:
3
Problem p03782 test case
Input:
3 6
1 4 3

Expected output:
1
Problem p03783 test case
Input:
3
1 3
5 7
1 3

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

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

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

Expected output:
7
Problem p03788 test case
Input:
5 1
ABAAA

Expected output:
BBAAA
Problem p03789 test case
Input:
80

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

Expected output:
26
Problem p03791 test case
Input:
3
1 2 3

Expected output:
4
Problem p03792 test case
Input:
2
#.
.#

Expected output:
3
Problem p03793 test case
Input:
axxxxza
2
1 7
2 6

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

Expected output:
2
Problem p03795 test case
Input:
20

Expected output:
15800
Problem p03796 test case
Input:
3

Expected output:
6
Problem p03797 test case
Input:
1 6

Expected output:
2
Problem p03798 test case
Input:
6
ooxoox

Expected output:
SSSWWS
Problem p03799 test case
Input:
1 6

Expected output:
2
Problem p03800 test case
Input:
6
ooxoox

Expected output:
SSSWWS
Problem p03801 test case
Input:
2
1 2

Expected output:
2
1
Problem p03802 test case
Input:
3
1 3
2 5
1 9

Expected output:
4
Problem p03803 test case
Input:
8 6

Expected output:
Alice
Problem p03804 test case
Input:
3 2
#.#
.#.
#.#
#.
.#

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

Expected output:
2
Problem p03806 test case
Input:
3 1 1
1 2 1
2 1 2
3 3 10

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

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

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

Expected output:
YES
Problem p03810 test case
Input:
3
3 6 7

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

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

Expected output:
2
Problem p03813 test case
Input:
1000

Expected output:
ABC
Problem p03814 test case
Input:
QWERTYASDFZXCV

Expected output:
5
Problem p03815 test case
Input:
7

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

Expected output:
3
Problem p03817 test case
Input:
7

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

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

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

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

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

Expected output:
3
Problem p03823 test case
Input:
5 3 7
1
3
6
9
12

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

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

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

Expected output:
15
Problem p03827 test case
Input:
5
IIDID

Expected output:
2
Problem p03828 test case
Input:
3

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

Expected output:
11
Problem p03830 test case
Input:
3

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

Expected output:
11
Problem p03832 test case
Input:
3 1 3 1 2

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

Expected output:
11
Problem p03834 test case
Input:
happy,newyear,enjoy

Expected output:
happy newyear enjoy
Problem p03835 test case
Input:
2 2

Expected output:
6
Problem p03836 test case
Input:
0 0 1 2

Expected output:
UURDDLLUUURRDRDDDLLU
Problem p03837 test case
Input:
3 3
1 2 1
1 3 1
2 3 3

Expected output:
1
Problem p03838 test case
Input:
10 20

Expected output:
10
Problem p03839 test case
Input:
5 3
-10 10 -10 10 -10

Expected output:
10
Problem p03840 test case
Input:
2 1 1 0 0 0 0

Expected output:
3
Problem p03841 test case
Input:
3
1 5 9

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

Expected output:
4
Problem p03843 test case
Input:
4
1 2
1 3
1 4
1100

Expected output:
4
Problem p03844 test case
Input:
1 + 2

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

Expected output:
6
9
Problem p03846 test case
Input:
5
2 4 4 0 2

Expected output:
4
Problem p03847 test case
Input:
3

Expected output:
5
Problem p03848 test case
Input:
5
2 4 4 0 2

Expected output:
4
Problem p03849 test case
Input:
3

Expected output:
5
Problem p03850 test case
Input:
3
5 - 1 - 3

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

Expected output:
9
2
Problem p03852 test case
Input:
a

Expected output:
vowel
Problem p03853 test case
Input:
2 2
*.
.*

Expected output:
*.
*.
.*
.*
Problem p03854 test case
Input:
erasedream

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

Expected output:
1 2 2 1
Problem p03856 test case
Input:
erasedream

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

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

Expected output:
4
Problem p03859 test case
Input:
5 2
01001
2 4
3 5

Expected output:
6
Problem p03860 test case
Input:
AtCoder Beginner Contest

Expected output:
ABC
Problem p03861 test case
Input:
4 8 2

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

Expected output:
1
Problem p03863 test case
Input:
aba

Expected output:
Second
Problem p03864 test case
Input:
3 3
2 2 2

Expected output:
1
Problem p03865 test case
Input:
aba

Expected output:
Second
Problem p03866 test case
Input:
-2 -2 2 2
1
0 0 1

Expected output:
3.6568542495
Problem p03867 test case
Input:
4 2

Expected output:
6
Problem p03868 test case
Input:
2
0
10
20
30

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

Expected output:
0.292893218813
Problem p03870 test case
Input:
3
2
3
4

Expected output:
3
Problem p03871 test case
Input:
25 25 25 25 0 0
0 0 0 0 50 50

Expected output:
1.000000000000
Problem p03872 test case
Input:
3
0 0 10
2 0 5
0 5 8

Expected output:
6.500000000000
Problem p03873 test case
Input:
4
2 7
2 5
4 1
7 5

Expected output:
22
Problem p03874 test case
Input:
7

Expected output:
FESSSSSSSTIVAL
Problem p03875 test case
Input:
2
0 1
1 0

Expected output:
6
Problem p03876 test case
Input:
8
90
90
270
90
90
90
270
90

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

Expected output:
2
Problem p03878 test case
Input:
2
0
10
20
30

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

Expected output:
0.292893218813
Problem p03880 test case
Input:
3
2
3
4

Expected output:
3
Problem p03881 test case
Input:
25 25 25 25 0 0
0 0 0 0 50 50

Expected output:
1.000000000000
Problem p03882 test case
Input:
3
0 0 10
2 0 5
0 5 8

Expected output:
6.500000000000
Problem p03883 test case
Input:
4
2 7
2 5
4 1
7 5

Expected output:
22
Problem p03884 test case
Input:
7

Expected output:
FESSSSSSSTIVAL
Problem p03885 test case
Input:
2
0 1
1 0

Expected output:
6
Problem p03886 test case
Input:
8
90
90
270
90
90
90
270
90

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

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

Expected output:
1.2000000000
Problem p03889 test case
Input:
pdbq

Expected output:
Yes
Problem p03890 test case
Input:
2
1
3
10
19

Expected output:
7
Problem p03891 test case
Input:
8
3
5

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

Expected output:
4
Problem p03893 test case
Input:
2

Expected output:
14
Problem p03894 test case
Input:
10 3
1 3
2 4
4 5

Expected output:
4
Problem p03895 test case
Input:
3
28800 57600
28800 57600
57600 28800

Expected output:
2
Problem p03896 test case
Input:
7

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

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

Expected output:
3
Problem p03899 test case
Input:
5 2 3
10 2 8 10 2

Expected output:
56
Problem p03900 test case
Input:
4
1 2 3 4
MmM

Expected output:
3
Problem p03901 test case
Input:
3
100

Expected output:
2.0000000
Problem p03902 test case
Input:
3 3
2 3 1
2 1 2
2 6 3

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

Expected output:
8
7
Problem p03904 test case
Input:
2
15267315

Expected output:
315
Problem p03905 test case
Input:
4
0 1
1 0
1 1
2 1

Expected output:
4
Problem p03906 test case
Input:
3
43 24 37

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

Expected output:
4
Problem p03908 test case
Input:
3
43 24 37

Expected output:
16
Problem p03909 test case
Input:
15 10
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snuke snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake

Expected output:
H6
Problem p03910 test case
Input:
4

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

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

Expected output:
3
Problem p03913 test case
Input:
8 1

Expected output:
7
Problem p03914 test case
Input:
3 3

Expected output:
2
Problem p03915 test case
Input:
7 1
5 2 1

Expected output:
21
Problem p03916 test case
Input:
5
2 7 1 8
1
2

Expected output:
0
Problem p03917 test case
Input:
2 2
cf
cf

Expected output:
6
Problem p03918 test case
Input:
3
0 0 1
1 1 0
3 0 1
0 1 1

Expected output:
L1
L1
L1
L3
D1
R2
U3
R3
D2
Problem p03919 test case
Input:
15 10
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snuke snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake

Expected output:
H6
Problem p03920 test case
Input:
4

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

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

Expected output:
3
Problem p03923 test case
Input:
8 1

Expected output:
7
Problem p03924 test case
Input:
3 3

Expected output:
2
Problem p03925 test case
Input:
7 1
5 2 1

Expected output:
21
Problem p03926 test case
Input:
5
2 7 1 8
1
2

Expected output:
0
Problem p03927 test case
Input:
2 2
cf
cf

Expected output:
6
Problem p03928 test case
Input:
3
0 0 1
1 1 0
3 0 1
0 1 1

Expected output:
L1
L1
L1
L3
D1
R2
U3
R3
D2
Problem p03929 test case
Input:
7 7

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

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

Expected output:
21
Problem p03933 test case
Input:
4 3

Expected output:
1.0000000000000
Problem p03934 test case
Input:
9 3
5 11
8 4
4 7

Expected output:
4
4
4
4
2
2
1
1
0
Problem p03935 test case
Input:
4 7

Expected output:
176
Problem p03937 test case
Input:
4 5
##...
.##..
..##.
...##

Expected output:
Possible
Problem p03938 test case
Input:
2
1 2

Expected output:
1 4
5 4
Problem p03939 test case
Input:
1 3 3

Expected output:
4.500000000000000
Problem p03940 test case
Input:
3 9 1
1 3 8

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

Expected output:
4
Problem p03942 test case
Input:
5
abcde
aaacc

Expected output:
2
Problem p03943 test case
Input:
10 30 20

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

Expected output:
9
Problem p03945 test case
Input:
BBBWW

Expected output:
1
Problem p03946 test case
Input:
3 2
100 50 200

Expected output:
1
Problem p03947 test case
Input:
BBBWW

Expected output:
1
Problem p03948 test case
Input:
3 2
100 50 200

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

Expected output:
Yes
5
6
6
5
7
Problem p03950 test case
Input:
10 10 4
1 6
4 1
6 9
9 4

Expected output:
32
Problem p03951 test case
Input:
3
abc
cde

Expected output:
5
Problem p03952 test case
Input:
4 4

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

Expected output:
-1.0
1.0
2.0
Problem p03954 test case
Input:
4
1 6 3 7 4 5 2

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

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

Expected output:
3
Problem p03957 test case
Input:
CODEFESTIVAL

Expected output:
Yes
Problem p03958 test case
Input:
7 3
3 2 2

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

Expected output:
4
Problem p03960 test case
Input:
2 3
rrr
brg

Expected output:
2
Problem p03961 test case
Input:
4
0 2 3 0

Expected output:
23
Problem p03962 test case
Input:
3 1 4

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

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

Expected output:
10
Problem p03965 test case
Input:
gpg

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

Expected output:
10
Problem p03967 test case
Input:
gpg

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

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

Expected output:
8
Problem p03970 test case
Input:
C0DEFESTIVAL2O16

Expected output:
2
Problem p03971 test case
Input:
10 2 3
abccabaabb

Expected output:
Yes
Yes
No
No
Yes
Yes
Yes
No
No
No
Problem p03972 test case
Input:
2 2
3
5
2
7

Expected output:
29
Problem p03973 test case
Input:
3
3
2
5

Expected output:
3
Problem p03974 test case
Input:
5
aa
abbaa
abbba
aaab
aaaaaba
5
1 abcdefghijklmnopqrstuvwxyz
2 bacdefghijklmnopqrstuvwxyz
3 abcdefghijklmnopqrstuvwxyz
4 bacdefghijklmnopqrstuvwxyz
5 abcdefghijklmnopqrstuvwxyz

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

Expected output:
4
Problem p03976 test case
Input:
9 3
APPLE
ANT
ATCODER
BLOCK
BULL
BOSS
CAT
DOG
EGG

Expected output:
3
Problem p03977 test case
Input:
3
3 1
4 108
1 10

Expected output:
255
400
10
Problem p03980 test case
Input:
4
_(4,51)?
^(99,_(3,67))?
_(0,87)?
3?

Expected output:
4 5
99 4
0 3
3 2
Problem p03981 test case
Input:
abcabc

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

Expected output:
2
Problem p03983 test case
Input:
2
20 8
20 12

Expected output:
24
20
Problem p03984 test case
Input:
4 2
2
3
1
1

Expected output:
12
Problem p03985 test case
Input:
4
0 -3 2 0 3 2
0 0 9 8 8 2
0 0 9 10 10 5
0 0 707 1000 1000 707

Expected output:
3
10
21
180
Problem p03986 test case
Input:
TSTTSS

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

Expected output:
9
Problem p03988 test case
Input:
5
3 2 2 3 3

Expected output:
Possible
Problem p03989 test case
Input:
3 1

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

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

Expected output:
3
7
3
Problem p03992 test case
Input:
CODEFESTIVAL

Expected output:
CODE FESTIVAL
Problem p03993 test case
Input:
4
2 1 4 3

Expected output:
2
Problem p03994 test case
Input:
xyz
4

Expected output:
aya
Problem p03995 test case
Input:
2 2
3
1 1 0
1 2 10
2 1 20

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

Expected output:
Yes
Problem p03997 test case
Input:
3
4
2

Expected output:
7
Problem p03998 test case
Input:
aca
accc
ca

Expected output:
A
Problem p03999 test case
Input:
125

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

Expected output:
0
0
0
2
4
0
0
0
0
0
Problem p04001 test case
Input:
125

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

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

Expected output:
1
Problem p04004 test case
Input:
1 1 1

Expected output:
17
Problem p04005 test case
Input:
3 3 3

Expected output:
9
Problem p04006 test case
Input:
2 10
1 100

Expected output:
12
Problem p04007 test case
Input:
5 5
.....
.#.#.
.....
.#.#.
.....

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

.###.
.#.#.
.#.#.
.#.#.
.....
Problem p04008 test case
Input:
3 1
2 3 1

Expected output:
2
Problem p04009 test case
Input:
3 3
o.o
.Eo
ooo

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

Expected output:
5
Problem p04011 test case
Input:
5
3
10000
9000

Expected output:
48000
Problem p04012 test case
Input:
abaccaba

Expected output:
Yes
Problem p04013 test case
Input:
4 8
7 9 8 9

Expected output:
5
Problem p04014 test case
Input:
87654
30

Expected output:
10
Problem p04015 test case
Input:
4 8
7 9 8 9

Expected output:
5
Problem p04016 test case
Input:
87654
30

Expected output:
10
Problem p04017 test case
Input:
9
1 3 6 13 15 18 19 29 31
10
4
1 8
7 3
6 7
8 5

Expected output:
4
2
1
2
Problem p04018 test case
Input:
aab

Expected output:
1
1
Problem p04019 test case
Input:
SENW

Expected output:
Yes
Problem p04020 test case
Input:
4
4
0
3
2

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

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

Expected output:
6
Problem p04023 test case
Input:
5 3
6
4
11

Expected output:
3
3
3
2
0
Problem p04024 test case
Input:
3 3 3
.#.
###
#.#

Expected output:
20
Problem p04025 test case
Input:
2
4 8

Expected output:
8
Problem p04026 test case
Input:
needed

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

Expected output:
4
Problem p04028 test case
Input:
3
0

Expected output:
5
Problem p04029 test case
Input:
3

Expected output:
6
Problem p04030 test case
Input:
01B0

Expected output:
00
Problem p04031 test case
Input:
2
4 8

Expected output:
8
Problem p04032 test case
Input:
needed

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

Expected output:
Positive
Problem p04034 test case
Input:
3 2
1 2
2 3

Expected output:
2
Problem p04035 test case
Input:
3 50
30 20 10

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

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

Expected output:
First
Problem p04038 test case
Input:
2 2

Expected output:
4
Problem p04039 test case
Input:
1000 8
1 3 4 5 6 7 8 9

Expected output:
2000
Problem p04040 test case
Input:
2 3 1 1

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

Expected output:
1
Problem p04042 test case
Input:
3 7
at
coder
codar

Expected output:
atcodar
Problem p04043 test case
Input:
5 5 7

Expected output:
YES
Problem p04044 test case
Input:
3 3
dxx
axx
cxx

Expected output:
axxcxxdxx
Problem p04045 test case
Input:
1000 8
1 3 4 5 6 7 8 9

Expected output:
2000
Problem p04046 test case
Input:
2 3 1 1

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

Expected output:
3