alexjercan/bugnet huggingface dataset:
Problem p00170 test case
Input:
4
sandwich 80 120
apple 50 200
cheese 20 40
cake 100 100
9
onigiri 80 300
onigiri 80 300
anpan 70 280
mikan 50 80
kanzume 100 500
chocolate 50 350
cookie 30 80
purin 40 400
cracker 40 160
0

Expected output:
apple
cake
sandwich
cheese
kanzume
purin
chocolate
onigiri
onigiri
anpan
mikan
cracker
cookie
Problem p00171 test case
Input:
zabZNq
BCxmAi
ZcbBCj
aizXCm
QgmABC
JHzMop
ImoXGz
MZTOhp
zabZnQ
BCxmAi
ZcbBCj
aizXCm
QgmABC
JHzMop
ImoXGz
MZTOhp
abcdef
ABDCFE
FBDCAE
abcdef
BEACDF
bfcaed
fabcde
DEABCF
UnivOf
AizuaH
zTXZYW
piglIt
GRULNP
higGtH
uAzIXZ
FizmKZ
UnivOf
AizuaH
piglIt
higGtH
GRULNP
uAzIXZ
FizmKZ
ZTXzYW
0

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

Expected output:
You can go home in 10 steps.
Switch on room 2.
Switch on room 3.
Move to room 2.
Move to room 3.
Switch off room 1.
Switch on room 4.
Move to room 2.
Move to room 4.
Switch off room 2.
Switch off room 3.
You can not switch off all lights.
Help me!
Problem p00173 test case
Input:
1a 132 243
1c 324 183
1f 93 199
2b 372 163
2c 229 293
2e 391 206
3a 118 168
3b 263 293
3d 281 102

Expected output:
1a 375 99300
1c 507 119700
1f 292 78300
2b 535 123300
2c 522 133700
2e 597 140000
3a 286 74000
3b 556 140500
3d 383 86800
Problem p00174 test case
Input:
ABAABBBAABABAAABBAA
AABBBABBABBAAABABABAAB
BABAABAABABABBAAAB
AABABAAABBAABBBABAA
AAAAAAAAAAA
ABBBBBBBBBB
0

Expected output:
11 8
10 12
11 7
11 8
11 0
0 11
Problem p00175 test case
Input:
7
4
0
12
10
10000
-1

Expected output:
13
10
0
30
22
2130100
Problem p00176 test case
Input:
#ffe085
#787878
#decade
#ff55ff
0

Expected output:
white
black
white
fuchsia
Problem p00177 test case
Input:
35.68 139.77 51.15 359.82
1.37 103.92 41.78 272.25
51.15 359.82 -34.58 301.52
-1 -1 -1 -1

Expected output:
9609
15092
11112
Problem p00178 test case
Input:
4
1 4 1
1 3 1
2 2 4
2 3 5
1
1 5 1
7
2 2 2
1 4 1
2 1 3
1 4 1
1 1 1
2 5 5
1 4 2
0

Expected output:
2
0
6
Problem p00179 test case
Input:
rbgrg
rbbgbbr
bgr
bgrbrgbr
bggrgbgrr
gbrggrbggr
rrrrr
bgbr
0

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

Expected output:
10
6
Problem p00181 test case
Input:
3 9
500
300
800
200
100
600
900
700
400
4 3
1000
1000
1000
0 0

Expected output:
1800
1000
Problem p00182 test case
Input:
10
11 2 23 4 2 12 8 5 2 10
8
2 1 3 11 2 3 1 4
9
5 9 1 2 4 8 17 1 8
8
3 38 9 4 18 14 19 5
1
1
0

Expected output:
YES
YES
YES
NO
YES
Problem p00183 test case
Input:
bbw
wbw
+b+
bwb
wbw
wbw
0

Expected output:
b
NA
Problem p00184 test case
Input:
8
71
34
65
11
41
39
6
5
4
67
81
78
65
0

Expected output:
2
1
0
2
1
0
2
0
0
0
0
0
0
4
Problem p00185 test case
Input:
134
4330
34808
98792
0

Expected output:
6
72
274
607
Problem p00186 test case
Input:
48 9297 240 126 32
20 3010 157 141 7
30 117002 5680 962 15
8 1673 1712 190 22
64 8478 87 54 307
23 5477 117 92 12
50 7558 1396 187 17
279 88677 4522 514 14
0

Expected output:
28 20
7 13
15 33
NA
97 0
12 44
NA
NA
Problem p00187 test case
Input:
-3 -2 9 6
3 -2 7 6
-1 0 5 0
2 2 -1 -1
0 1 2 1
-3 -1 3 1
0 0 0 0

Expected output:
syo-kichi
kyo
Problem p00188 test case
Input:
7
11
15
23
36
51
61
86
51
4
1
2
3
5
4
0

Expected output:
3
3
Problem p00189 test case
Input:
6
0 1 80
1 2 20
0 2 60
2 3 50
3 4 60
1 4 90
2
0 1 1
1 2 1
0

Expected output:
2 240
1 2
Problem p00190 test case
Input:
2
1 0 3
4 5 6 7 8
9 0 11
10
0
1 2 3
4 5 6 7 8
9 10 11
0
0
11 10 9
8 7 6 5 4
3 2 1
0
-1

Expected output:
2
0
NA
Problem p00191 test case
Input:
3 3
1.3 3.0 0.5
2.4 2.1 1.0
3.0 0.8 1.2
2 2
1.0 1.0
1.0 1.0
0 0

Expected output:
9.00
1.00
Problem p00192 test case
Input:
3 5
90
52
82
84
70
2 4
10
30
40
60
0 0

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

Expected output:
4
4
Problem p00194 test case
Input:
4 5
1
3
b-2 3
c-3 2
c-4 1
3
a-2 b-2
b-3 c-3
d-3 d-4
2
b-3 b-4 1
c-1 d-1 1
d-1 b-4
4 5
1
3
b-2 3
c-3 2
c-4 1
3
a-2 b-2
b-3 c-3
d-3 d-4
2
b-3 b-4 1
c-1 d-1 1
d-2 b-4
4 5
1
3
b-2 3
c-3 2
c-4 1
3
a-2 b-2
b-3 c-3
d-3 d-4
2
b-3 b-4 1
c-1 d-1 1
d-3 b-4
0 0

Expected output:
7
4
8
Problem p00195 test case
Input:
1593 4311
4321 2155
1256 6421
5310 1455
2152 5421
1549 3386
4528 3719
1234 4321
3330 3109
2739 2199
0 0

Expected output:
C 7677
B 8247
Problem p00196 test case
Input:
6
A 1 0 0 2 0
B 0 0 1 1 0
C 1 1 1 1 1
D 1 0 0 1 2
E 2 0 0 0 0
F 1 1 0 2 1
4
g 1 1 1
h 0 1 2
w 0 0 0
b 0 2 1
0

Expected output:
E
A
B
D
F
C
w
h
b
g
Problem p00197 test case
Input:
1071 1029
5 5
0 0

Expected output:
21 3
5 1
Problem p00198 test case
Input:
3
Cyan Yellow Red Magenta Green Blue
Cyan Yellow Red Magenta Green Blue
Red Yellow Magenta Blue Green Cyan
4
Red Magenta Blue Green Yellow Cyan
Red Yellow Magenta Blue Green Cyan
Magenta Green Red Cyan Yellow Blue
Cyan Green Yellow Blue Magenta Red
0

Expected output:
1
1
Problem p00199 test case
Input:
5 4
A
B
C
D
5 4
D
C
B
A
0 0

Expected output:
ACD#B
DCA#B
Problem p00200 test case
Input:
6 5
1 2 200 10
1 4 400 15
1 3 250 25
2 4 100 10
4 5 150 20
3 5 300 20
2
1 5 0
1 5 1
0 0

Expected output:
450
35
Problem p00201 test case
Input:
8
wood 3000
string 800
rice 36
water 0
racket 5000
microphone 9800
onigiri 140
guitar 98000
3
racket 2 wood string
onigiri 2 rice water
guitar 3 racket microphone onigiri
guitar
1
computer 300000
0
computer
0

Expected output:
13636
300000
Problem p00202 test case
Input:
4 15000
305
260
129
500
3 400
10
20
30
3 200909
5
9
12
0 0

Expected output:
14983
NA
200909
Problem p00203 test case
Input:
5 5
0 0 0 0 1
2 1 0 2 0
1 0 0 1 1
0 2 1 2 0
0 1 0 0 0
5 5
0 0 1 0 0
2 1 0 2 0
1 0 0 1 1
0 2 1 2 0
0 1 0 0 0
15 15
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 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 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 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0

Expected output:
8
6
52694573
Problem p00204 test case
Input:
100 5
101 101 5 5
110 110 2 3
-112 -100 9 11
-208 160 82 90
-110 108 10 2
10 11
15 0 5 1
25 0 5 1
35 0 5 1
45 0 5 1
55 0 5 1
65 0 5 1
75 0 5 1
85 0 5 1
95 0 5 1
-20 0 5 20
-30 0 500 5
0 0

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

Expected output:
3
3
3
3
3
1
2
2
2
1
Problem p00206 test case
Input:
10000
5000 3150
5000 5000
0 0
5000 1050
5000 3980
5000 210
5000 5000
5000 5000
0 0
5000 2100
5000 2100
5000 2100
29170
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 70831
0

Expected output:
6
NA
Problem p00207 test case
Input:
20 20
1 1
9 9
7
2 0 1 1
5 1 1 3
2 1 3 3
1 1 5 2
5 1 7 3
2 0 2 7
2 0 6 8
20 20
9 9
1 1
6
2 0 1 1
1 0 5 1
2 1 1 3
5 0 1 7
3 1 5 5
4 1 8 5
0 0

Expected output:
OK
NG
Problem p00208 test case
Input:
15
100
1000000000
3
0

Expected output:
19
155
9358757000
3
Problem p00209 test case
Input:
8 4
2 1 3 1 1 5 1 3
2 3 2 4 1 0 2 1
0 3 1 2 1 1 4 2
1 2 3 2 1 1 5 4
0 2 0 1 1 3 2 1
1 3 1 2 2 4 3 2
5 1 2 1 4 1 1 5
4 1 1 0 1 2 2 1
2 -1 -1 -1
0 3 -1 -1
-1 2 2 4
-1 1 -1  1
5 3
1 0 2 3 5
2 3 7 2 1
2 5 4 2 2
8 9 0 3 3
3 6 0 4 7
-1 -1 2
-1 3 5
0 4 -1
0 0

Expected output:
4 2
NA
Problem p00210 test case
Input:
10 3
##########
#E.......X
##########
4 4
####
#N.#
#..X
####
5 5
#####
#N..#
###.X
#S..#
#####
6 6
######
#..#X#
#.EE.#
####N#
#....#
######
8 8
##X#####
#....E.#
#####.##
#.#...##
#.W.#..#
#.#.N#.X
#X##.#.#
########
0 0

Expected output:
8
NA
9
16
10
Problem p00211 test case
Input:
2
4 3
5 4
5
789 289
166 46
9 4
617 252
972 303
2
8 5
32 20
0

Expected output:
15
16
1598397732
1209243492
1939462992
1782294192
1360317793
1
1
Problem p00212 test case
Input:
1 3 3 1 3
1 3 2000
1 2 1000
2 3 1000
2 3 3 1 3
1 3 2300
1 2 1000
2 3 1200
2 6 6 5 1
1 2 1500
1 3 4500
2 6 2000
5 4 1000
6 4 2200
3 5 3000
0 0 0 0 0

Expected output:
1000
1100
3750
Problem p00213 test case
Input:
5 4 6
1 6
2 4
3 3
4 4
5 1
6 2
0 0 1 0 0
0 0 0 2 0
0 0 0 3 0
0 4 5 0 6
3 3 1
1 9
0 0 1
0 0 0
0 0 0
4 4 4
1 6
2 2
3 4
4 4
0 1 0 0
0 0 0 2
0 0 3 0
0 4 0 0
0 0 0

Expected output:
1 1 1 2 2
1 1 1 2 2
4 4 3 3 3
4 4 5 6 6
1 1 1
1 1 1
1 1 1
NA
Problem p00214 test case
Input:
3
1
0 0 0 1 1 1 1 0
2
0 0 0 1 1 1 1 0
100 100 100 200 200 200 200 100
2
0 0 0 100 100 100 100 0
10 10 10 20 20 20 20 10
2
1
30 40 40 50 40 20 20 10
1
30 40 40 50 40 20 20 10
0

Expected output:
1
2
1
1
1
Problem p00215 test case
Input:
6 6
S.1..4
3..5..
..4.1.
4....5
.2.32.
5.1..G
3 2
...
S.G
0 0

Expected output:
2 10
NA
Problem p00216 test case
Input:
29
40
0
-1

Expected output:
620
-1120
3130
Problem p00217 test case
Input:
5
263 2345 2504
1 3210 1985
5000 1501 4132
10000 503 3107
51 1758 2690
3
345 5000 2396
7 3910 1590
6789 2525 3616
0

Expected output:
5000 5633
345 7396
Problem p00218 test case
Input:
4
100 70 20
98 86 55
80 34 36
65 79 65
2
99 81 20
66 72 90
0

Expected output:
A
A
B
C
A
B
Problem p00219 test case
Input:
15
2
6
7
0
1
9
8
7
3
8
9
4
8
2
2
3
9
1
5
0

Expected output:
*
*
***
*
*
-
*
**
***
**
-
*
-
-
-
*
-
-
-
*
Problem p00220 test case
Input:
23.5
158.1
-1.0

Expected output:
00010111.1000
NA
Problem p00221 test case
Input:
5 7
1
2
Fizz
4
Buzz
6
7
3 5
1
2
3
4
5
0 0

Expected output:
2 3 4 5
1
Problem p00222 test case
Input:
13
14
15
16
17
18
19
20
10000
0

Expected output:
13
13
13
13
13
13
19
19
9439
Problem p00223 test case
Input:
6 6
2 4
6 2
0 0 0 0 1 0
0 1 0 0 0 0
0 1 0 0 0 0
0 0 0 1 0 0
0 0 0 0 0 1
0 0 0 0 0 0
3 3
1 1
3 3
0 0 0
0 1 0
0 0 0
0 0

Expected output:
3
NA
Problem p00224 test case
Input:
1 1 2 5
35
H L1 5
C1 D 6
C1 H 12
L1 D 10
C1 L1 20
2 1 4 6
100 70
H L1 5
C1 L1 12
C1 D 11
C2 L1 7
C2 D 15
L1 D 8
0 0 0 0

Expected output:
1
-2
Problem p00225 test case
Input:
5
apple
yellow
georgia
king
email
7
apple
yellow
georgia
king
email
wink
lucky
0

Expected output:
NG
OK
Problem p00226 test case
Input:
1234 5678
1234 1354
1234 1234
1230 1023
0123 1234
0 0

Expected output:
0 0
2 1
4 0
1 3
0 3
Problem p00227 test case
Input:
4 2
50 40 100 80
7 3
400 300 100 700 200 600 500
0 0

Expected output:
150
2100
Problem p00228 test case
Input:
3
0
5
1
1
0
-1

Expected output:
0111111
1010010
1101011
0111111
Problem p00229 test case
Input:
3 2 30 3 26 226
9 0 18 3 20 118
5 5 12 2 15 203
7 4 19 2 22 197
7 4 24 4 17 209
0 0 0 0 0 0

Expected output:
127
793
414
629
617
Problem p00230 test case
Input:
8
0 0 0 2 2 2 0 0
1 1 1 1 0 0 0 0
4
1 1 2 2
0 0 2 2
0

Expected output:
4
NA
Problem p00231 test case
Input:
3
80 0 30
50 5 25
90 27 50
3
80 0 30
70 5 25
71 30 50
0

Expected output:
NG
OK
Problem p00232 test case
Input:
1 2 0
1
1 2 1
1
1 2 100
1 2 1
2
1 2 100
2 2 1
1 2
1 2 100
4 5 3
1 2 3 4
1 1 2
2 2 100
4 3 60
0 0 0

Expected output:
0
100
0
50
20
Problem p00233 test case
Input:
9
10
-10
-1944
-305432133
0

Expected output:
9
190
10
2156
1715573947
Problem p00234 test case
Input:
3 3
100 10 10
-100 -20 -100
-100 -20 -100
-100 -20 -100
3 3
100 10 10
-100 -20 -100
-100 -20 -20
-100 -60 -20
3 3
100 10 3
-100 -20 -100
-20 -20 -20
-20 -100 -20
3 3
100 3 3
-100 -20 -30
-100 -20 2
-100 -20 -20
4 5
1500 5 4
-10 -380 -250 -250
-90 2 -80 8
-250 -130 -330 -120
-120 -40 -50 -20
-250 -10 -20 -150
0 0

Expected output:
60
80
NA
50
390
Problem p00235 test case
Input:
7
1 2 5
2 3 2
3 4 3
2 5 3
5 6 3
5 7 8
0

Expected output:
12
Problem p00236 test case
Input:
5 4
0 0 0 0 0
0 1 1 0 0
0 0 1 0 1
1 0 0 0 1
5 4
0 0 0 0 0
0 1 1 0 0
0 0 0 0 1
1 0 0 0 1
0 0

Expected output:
Yes
No
Problem p00237 test case
Input:
3 4
1 0 3 0 2 1
2 3 2 5 3 4
5 3 5 5 6 4
3 2
1 0 3 0 2 1
2 3 2 5 3 4
5 3 5 5 6 4
0 0

Expected output:
1
3
Problem p00238 test case
Input:
10
3
6 11
12 15
18 22
14
2
6 11
13 20
0

Expected output:
OK
2
Problem p00239 test case
Input:
4
1 7 14 47
2 5 35 55
3 6 3 59
4 6 5 15
10 15 50 400
2
1 8 10 78
2 4 18 33
10 10 50 300
0

Expected output:
1
4
NA
Problem p00240 test case
Input:
2
8
1 5 2
2 6 1
2
9
1 5 2
2 6 1
0

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

Expected output:
-58 16 36 32
-50 32 28 48
Problem p00242 test case
Input:
1
ben likes bananas the best among many fruits because bananas are sweet and cheap
b
1
winners get to visit aizu and the university of aizu and make many friends as well
a
3
ask alex about
the answer for the
assignment on android apps
a
2
programming is both
a sport and an intellectual puzzle
c
0

Expected output:
bananas because ben best
aizu and as
about alex android answer apps
NA
Problem p00243 test case
Input:
3 3
R G B
G G G
G B B
2 4
R G
G G
R B
B R
4 3
G G B R
G R R G
B G G R
0 0

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

Expected output:
5
0
7
Problem p00245 test case
Input:
6 5
1 1 . 0 0 4
1 . . . . .
. . 2 2 . .
. . 2 2 3 3
P . . . . .
5
0 50 5 10
1 20 0 10
2 10 5 15
3 150 3 5
4 100 8 9
0 0

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

Expected output:
1
4
4
Problem p00247 test case
Input:
5 5
.X.S.
.X#..
.XX##
.#XG.
..X..
7 3
SXX.XXG
X.#.#X.
XXX.XX#
4 4
S...
X.X.
GX..
...X
10 10
..XXXXX.XX
.X.#.#X.XX
SX.#X.X..X
#X.##.X.XX
..XXXX#.XX
##.##.##XX
....X.XX#X
.##X..#X#X
....XX#..X
...#XXG..X
0 0

Expected output:
11
10
10
33
Problem p00248 test case
Input:
5 4
1 2
2 3
3 4
4 5
4 6
1 2
1 3
1 4
2 3
2 4
3 4
5 0
0 0

Expected output:
yes
no
yes
Problem p00249 test case
Input:
4 1 1
0 0
1 0
1 2
0 2
0 0 0

Expected output:
1.000000
Problem p00250 test case
Input:
5 11
11 27 34 45 56
8 5
0 2 1 5 4 6 8 3
5 2
2 4 2 4 6
10 18
10 15 12 31 12 50 11 23 43 181
1 100
5
0 0

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

Expected output:
55
Problem p00252 test case
Input:
0 0 1

Expected output:
Open
Problem p00253 test case
Input:
5
1 2 3 6 4 5
6
1 3 6 9 12 15 18
4
5 7 9 11 12
0

Expected output:
6
1
12
Problem p00254 test case
Input:
6174
2012
3333
0000

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

Expected output:
12
48
76
Problem p00256 test case
Input:
2012.12.31
2.12.16.14.14
7138.5.13
10.5.2.1.5
10000000.12.31
#

Expected output:
0.0.0.0.10
3054.8.15
0.0.0.0.10
6056.2.29
8.19.3.13.2
Problem p00257 test case
Input:
3
3
-2
1
0
2
4
2
0
-1
-2
2
2
-2
-2
0

Expected output:
OK
NG
NG
Problem p00258 test case
Input:
2 2
0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1
1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0
0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1
1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0
2 2
0 0 1 0 1 1 1 1 0 0 1 0 0 0 1 0
0 1 0 1 0 1 1 1 0 1 0 1 0 0 0 0
0 0 1 0 1 0 0 0 0 0 1 0 0 0 1 0
0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0
5 3
0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0
1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1
0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0
0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0
0 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0
0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0
1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0
0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1
0 0

Expected output:
8
7
16
Problem p00259 test case
Input:
5: 2 - 3
17: 1 + 3 * (2 + 3 / 5 * 2) + 7
11: 1 / 8 - 5 - 8 * 2
19: 8 / (2 - 3 * 7)
1153: 10 * 3 / 7 + ( 50 + 81 / 22 ) + 11
0:

Expected output:
2-3 = 4 (mod 5)
1+3*(2+3/5*2)+7 = 4 (mod 17)
1/8-5-8*2 = 8 (mod 11)
NG
10*3/7+(50+81/22)+11 = 915 (mod 1153)
Problem p00260 test case
Input:
8
0 0
3 2
6 2
8 6
6 5
7 7
0 4
3 4
8
0 0
5 3
5 2
4 1
6 1
8 6
6 4
2 4
0

Expected output:
1
2
Problem p00261 test case
Input:
0100
0101
10100
01000
0101011
0011
011111
#

Expected output:
Yes
No
Yes
No
Yes
No
Yes
Problem p00262 test case
Input:
6
1 4 1 3 2 4
5
1 2 3 4 5
10
1 1 1 1 1 1 1 1 1 1
9
1 1 1 1 1 1 1 1 1
12
1 4 1 3 2 4 3 3 2 1 2 2
1
5050
3
10000 10000 100
0

Expected output:
24
0
10
-1
48
5049
-1
Problem p00263 test case
Input:
8
00000000
80000000
00000080
00000040
000000c0
00000100
80000780
80000f70

Expected output:
0.0
-0.0
1.0
0.5
1.5
2.0
-15.0
-30.875
Problem p00264 test case
Input:
6 3
2 1
1 2
5 2
1 3
1 5
-2 3
1 1 1 90 30 45
3 -4
-3 0
2 -2
45 6
90 6
135 6
2 1
1 3
5 2
0 1 1 90 30 45
-3 0
2 -2
45 6
0 0

Expected output:
5 6
NA
Problem p00265 test case
Input:
3 3
9 3 8
4
6
5

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

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

Expected output:
3
1
NA
Problem p00268 test case
Input:
4 4
0 0
1 0
1 1
0 1
1 2
1 4
2 3
3 4
12 22
2 0
4 0
8 0
4 2
6 2
8 2
2 4
4 4
6 4
0 6
8 6
0 8
1 2
2 3
1 4
1 7
1 10
2 4
2 5
3 5
3 6
4 5
4 8
5 6
5 9
6 9
6 11
7 10
7 8
8 9
9 11
10 11
10 12
11 12
0 0

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

Expected output:
-1
9
6
7
Problem p00270 test case
Input:
6 7
1 2 3
1 4 1
2 3 5
4 3 1
3 6 2
4 5 2
5 6 1
1 6 6
1 6
4 3
4 6
5 6
2 6
2 5

Expected output:
Yes
Yes
Yes
Yes
No
No
Problem p00271 test case
Input:
30 19
39 20
19 18
25 20
22 21
23 10
10 -10

Expected output:
11
19
1
5
1
13
20
Problem p00272 test case
Input:
3 10
1 4
4 1
2 5

Expected output:
30000
24000
2000
20000
Problem p00273 test case
Input:
2
100 100 1 1
1000 500 5 2

Expected output:
200
4800
Problem p00274 test case
Input:
2
3 2
3
0 1 1
1
1000
0

Expected output:
3
NA
2
Problem p00275 test case
Input:
2
SSSSSSSSSSSSSSSLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
2
SSSSSSSSSSSSSSLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMSL
5
MMMMMMSLSLLMMMSMMSLMMMLMMMMLSLLLLMLSMMLMMLLMSSSLMMMMLMLSMLMSMMMMMMMSMMMMMMLMMMMMSMMMLMMLMMMMMMMMMSSM
0

Expected output:
42 58 0
0 100 0
0 0 3 10 59 28
Problem p00276 test case
Input:
4
3 0 0
1 1 1
9 4 1
0 1 2

Expected output:
1
1
4
0
Problem p00277 test case
Input:
3 4 600
3 100 5
1 200 10
2 400 20
3 500 20

Expected output:
1
Problem p00278 test case
Input:
5 8
5
10
8
7
3
ADD 1
ADD 3
CHECK 0
CHECK 1
CHECK 2
CHECK 3
CHECK 4
CHECK 5

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

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

Expected output:
AABB
ABAB
ABBA
BAAB
BABA
BBAA
Problem p00281 test case
Input:
4 6
1 2 1
2 3 2
2 4 3
3 1 5
4 2 4
4 3 2
4 6 10
0 0 0
3
1 3 2 4 0 10
6 5 4 3 2 1
5 1 1 5 5 1

Expected output:
3 16 5 116
5 17 30 38
1 17 25 16
Problem p00282 test case
Input:
2 10
5 20
10 8
20 17
0 0

Expected output:
1024
95Cho3674Oku3164Man625
1Oku
131Gai720Kei
Problem p00283 test case
Input:
15 4
1 1 0
1 2 2
5 10 5
8 1 15
60 4
5 2 0
8 8 2
3 5 0
49 0 18
100 1
1 1 1
0 0

Expected output:
6
4
NA
Problem p00284 test case
Input:
3
0 7
-1048576 0
-3 5

Expected output:
3
1
4
Problem p00285 test case
Input:
3 3
0 20 30
10 20 30
10 10
32 10 15 8 20 10 6 45 50 41
18 0 37 25 45 11 25 21 32 27
7 3
23 14 39 6 47 16 23
19 37 8
0 0

Expected output:
12000
53906
11629
Problem p00286 test case
Input:
5 2
A 5
1 0 0 1
0 1 0 0
1 0 1 0
0 1 0 1
B 4
1 0 0 1
0 1 0 0
0 0 1 0
2
2(A+B)
1000000000(1000000000A+1000000000B)

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

Expected output:
3
1
Problem p00288 test case
Input:
1 1 1
0 0
0 0 1 0
1 1 0
0 0
-3 0 2 3
1 3 1
0 0
-3 0 2 3
0 -5 2 0
4 0 2 1
4 3 1
0 0
0 0
0 0
0 0
-3 0 2 3
0 -5 2 0
4 0 2 1
6 3 1
0 0
0 0
0 0
0 0
0 0
0 0
-3 0 2 3
0 -5 2 0
4 0 2 1
6 3 2
0 0
0 0
0 0
0 0
0 0
0 0
-3 0 2 3
0 -5 2 0
4 0 2 1
10 5 1
0 0
2 0
4 0
8 0
100 0
100 0
100 0
100 0
100 0
100 0
-3 0 1 0
1 0 1 0
3 0 2 0
15 0 1 0
105 0 6 0
10 5 2
0 0
2 0
4 0
8 0
100 0
100 0
100 0
100 0
100 0
100 0
-3 0 1 0
1 0 1 0
3 0 2 0
15 0 1 0
105 0 6 0
0 0 0

Expected output:
0
3
5
11
18
28
20
38
Problem p00289 test case
Input:
6 7
1 2
2 3
1 3
1 4
4 5
5 6
6 1
5
2
3
4
5
6

Expected output:
2
3
4
4
5
Problem p00290 test case
Input:
20 2

Expected output:
40
Problem p00291 test case
Input:
3 1 4 0 4 1

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

Expected output:
1
2
2
Problem p00293 test case
Input:
2 9 8 15 59
1 8 27

Expected output:
8:27 9:08 15:59
Problem p00294 test case
Input:
5 4 0
1
2
3
4

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

Expected output:
0
1
2
7
Problem p00296 test case
Input:
10 5 3
2 6 5 18 3
3 0 5

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

Expected output:
16
Problem p00298 test case
Input:
3
150 120
100 50
80 100

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

Expected output:
3
Problem p00300 test case
Input:
4
300 120
300 105
250 105
250 90

Expected output:
23
18 23
17 18 22 23
17 18
Problem p00301 test case
Input:
25

Expected output:
+0-+
Problem p00302 test case
Input:
1 10 20
1

Expected output:
11
Problem p00303 test case
Input:
4
1 lock 1
2 lock 2
1 wait 2
2 wait 1

Expected output:
1
Problem p00304 test case
Input:
12
A
E
E
E
R?
E?
E?
E
E
E
E?
E
1 2
1 3
1 4
2 5
4 6
4 7
5 8
5 9
7 10
7 11
11 12

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

Expected output:
12
Problem p00306 test case
Input:
90 10

Expected output:
0.0
Problem p00307 test case
Input:
3 4
2 2
3 3
4 4
3 3
4 4
1 1
2 2

Expected output:
3
Problem p00308 test case
Input:
6
oooxxxx
ooooxxx
oxxooxxo
ooxx
oo
ooo

Expected output:
-1
7
split 0 0
join 2 1
split 3 4
split 4 0
join 7 6
split 8 2
split 9 0
3
split 0 1
split 2 1
split 4 1
-1
0
1
split 0 0
Problem p00309 test case
Input:
6 7
1 2 1
2 3 2
3 1 3
4 5 4
5 6 5
6 4 6
1 4 7

Expected output:
7 18
Problem p00310 test case
Input:
10 10 20

Expected output:
40
Problem p00311 test case
Input:
5 1
3 1
1 2 5 5

Expected output:
hiroshi
Problem p00312 test case
Input:
10 5

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

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

Expected output:
4
Problem p00315 test case
Input:
7 8
00100000
00011000
10111101
01100110
01000110
10111101
00011000
00100100
2
5 3
1 6
1
6 8
3
6 8
3 3
3 6
2
6 3
6 6
0
2
3 8
6 8

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

Expected output:
4
Problem p00317 test case
Input:
5 4
aloe
apple
apricot
cactus
cat
apple
ap*
*e
ca?*

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

Expected output:
1.936
Problem p00319 test case
Input:
3 3
1 2 1 2
2 3 1 2
1 3 1 3

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

Expected output:
yes
Problem p00321 test case
Input:
5 2
3 bread milk banana
2 milk cornflakes
3 potato bread milk
4 cornflakes bread milk butter
2 potato bread

Expected output:
3
bread milk
bread potato
cornflakes milk
Problem p00322 test case
Input:
7 6 -1 1 -1 9 2 3 4

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

Expected output:
3 0
5 0
Problem p00324 test case
Input:
5
18
102
-155
53
32

Expected output:
3
Problem p00325 test case
Input:
6
10 SET c 1
20 SET i 5
100 ADD s s i
110 SUB i i c
120 IF i 100
200 HALT

Expected output:
c=1
i=0
s=15
Problem p00326 test case
Input:
5 3
1 5 2
3 8 5
1 2 3
5 5 5
4 8 2
0
1 2 3
2
2 2 3 1
4 3 1 2

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

Expected output:
yes
Problem p00328 test case
Input:
9
0 2 5 2
1 3 1 7
0 6 3 6
2 4 8 4
4 0 4 5
6 3 6 0
5 6 7 6
8 3 8 7
6 5 11 5

Expected output:
1
1
0
1
0
1
1
0
1
Problem p00329 test case
Input:
6
1 0 0 0 1
1 0 1 0 1
0 1 0 1 0
0 0 0 1 0
0 1 0 0 1

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

Expected output:
128
Problem p00331 test case
Input:
-3 3

Expected output:
0
Problem p00332 test case
Input:
0 2015

Expected output:
H27
Problem p00333 test case
Input:
10 20 5

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

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

Expected output:
4