alexjercan/bugnet huggingface dataset:
Problem p01114 test case
Input:
4
1
0 1
1 2
-1 2
2 1
4
1
1 1
2 2
1 3
1 4
4
1
1 1
2 2
3 1
4 1
4
1
1 2
2 1
3 2
4 2
5
2
0 1
0 2
0 3
0 4
0 5
6
3
0 2
2 2
1 1
0 3
2 3
1 4
0

Expected output:
6.000000000000
6.928203230276
6.000000000000
7.732050807569
6.928203230276
6.000000000000
Problem p01115 test case
Input:
3
(1+2)*3+3
2
1*1*1+1*1*1
587
1*(2*3*4)+5+((6+7*8))*(9)
0

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

Expected output:
18
108
35
Problem p01117 test case
Input:
5 2
10 20 30 40 50
15 25 35 45 55
6 3
10 20 30 15 25 35
21 34 11 52 20 18
31 15 42 10 21 19
4 2
0 0 0 0
0 0 0 0
0 0

Expected output:
105
83
0
Problem p01118 test case
Input:
3 9
ABCDEFGHI
JKLMNOPQR
STUVWXYZ_
ICPC
5 11
___________
____A______
________M__
___________
_C_________
ACM
4 21
1_2_3_4_5_6_7_8_9_0_-
QqWwEeRrTtYyUuIiOoPp@
AaSsDdFfGgHhJjKkLl;_:
ZzXxCcVvBbNnMm,_._/__
ICPC2019,AsiaYokohamaRegional,QualificationRound
0 0

Expected output:
28
23
493
Problem p01119 test case
Input:
4 2
9 2 7 11
2 9
6 2
7 3 6 12 16 9
2 9
5 2
7 3 6 12 17
2 9
7 5
15 21 33 48 51 75 111
36 54 57 93 113
0 0

Expected output:
0
5
-1
5
Problem p01120 test case
Input:
4 5
2 3 1 4
2 5 5 2
3 100
1 10 100
1 10 100
5 10000
4971 7482 1238 8523 1823
3287 9013 9812 297 1809
0 0

Expected output:
4
0
14731
Problem p01121 test case
Input:
5
..XX.
.XXX.
XXXXX
XXXXX
X....
....X
XXXXX
.XXX.
.XXX.
.....
..XXX
XXXX.
.XXXX
.XXXX
...X.
...X.
.XXXX
XXXX.
XXXX.
.X.X.
XXX.X
.XXXX
XXXXX
.XXXX
.XXXX
XX...
.XXXX
XXXXX
XXXXX
XX...
5
..XX.
.XXX.
XXXXX
XXXX.
X....
....X
XXXXX
.XXX.
.XXX.
.....
.XXXX
XXXX.
.XXXX
.XXXX
...X.
...X.
.XXXX
XXXX.
XXXX.
.X.X.
XXX.X
.XXXX
XXXXX
.XXXX
.XXXX
XX...
XXXXX
XXXXX
.XXXX
XX...
0

Expected output:
Yes
No
Problem p01122 test case
Input:
4
3 3 1
2 6
-4
3
1 -10
100
5
-2 -2 -2 -2
-1 -1 -1
-1 -1
1
4
-4 7 6
2 3
-1
0

Expected output:
7
11
-1
9
Problem p01123 test case
Input:
4
..E.
.AD.
B...
..C.
D
4
..E.
.AD.
B...
..C.
DR
3
...
.A.
BC.
((URD)3L)2R
5
...P.
PPPPP
PPP..
PPPPP
..P..
LRLR(LR)12RLLR
20
....................
....................
.III..CC..PPP...CC..
..I..C..C.P..P.C..C.
..I..C....P..P.C....
..I..C....PPP..C....
..I..C....P....C....
..I..C..C.P....C..C.
.III..CC..P.....CC..
....................
..XX...XX...X...XX..
.X..X.X..X..X..X..X.
....X.X..X..X..X..X.
...X..X..X..X..X..X.
...X..X..X..X...XXX.
..X...X..X..X.....X.
..X...X..X..X.....X.
.XXXX..XX...X...XX..
....................
....................
((LDRU)1000(DLUR)2000(RULD)3000(URDL)4000)123456789012
6
...NE.
MFJ..G
...E..
.FBN.K
....MN
RA.I..
((((((((((((((((((((((((URD)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L)2L
0

Expected output:
....
..E.
..D.
BAC.
....
...E
...D
.BAC
...
..C
.AB
....P
PPPPP
..PPP
PPPPP
....P
....................
....................
....................
....................
....................
XXXX................
PXXXX...............
CXXXX...............
XXXXX...............
XXPCXX..............
CCXXCX..............
CXXXXX..............
CXXXXX..............
CPCIXXX.............
CXPPCXX.............
PCXXXIC.............
CPPCCXI.............
CXCIPXXX............
XCPCICIXX...........
PIPPICIXII..........
......
......
N.....
JNG...
RMMKFE
BEAIFN
Problem p01124 test case
Input:
5 3
0 0
2 0
2 1
1 2
0 2
0 0
1 0
0 1
4 4
0 0
5 0
5 5
0 5
0 0
2 0
2 2
0 2
3 3
0 0
1 0
0 1
0 1
0 0
1 1
3 3
0 0
1 0
1 1
0 0
1 0
1 1
4 4
0 0
2 0
2 2
0 2
0 0
1 0
1 2
0 2
4 4
0 0
3 0
3 1
0 1
0 0
1 0
1 1
0 1
0 0

Expected output:
3
2
2
1
0
2
Problem p01125 test case
Input:
2
10 11
11 12
2
N 2
E 1
2
10 11
11 12
2
N 2
W 1
3
0 15
5 10
5 15
5
W 10
S 10
N 20
E 10
S 10
0

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

Expected output:
4
Problem p01127 test case
Input:
6
1 1
.
3 3
...
.W.
...
10 10
..........
.DDDDCCC..
.DDDDCCC..
.DDDDCCC..
ADDDDCCC..
AAA..CCC..
AAABBBBC..
AAABBBB...
..BBBBB...
..........
10 10
..........
.DDDDDD...
.DDDDCCC..
.DDDDCCC..
ADDDDCCC..
AAA..CCC..
AAABBBBC..
AAABBBB...
..BBBBB...
..........
10 10
R..E..C.T.
R.EEE.C.T.
.EEEEE....
EEEEEEE...
.EEEEEEE..
..EEEEEEE.
...EEEEEEE
....EEEEE.
.....EEE..
......E...
16 50
..................................................
.........AAAAAAAAAAAAAAAA.........................
....PPP...AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.....
....PPP...AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.....
....PPP...AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA....
....PPP..............AAAAA.AAAAAAAAAAAAAAAA.......
....PPP................A....AAA.AAAAAAAAAA........
....PPP...........IIIIIAAIIAIII.AAAAAAAAAA........
..CCCCCCCCCCCCC...IIIIIIAAAAAAAAAAAAAAAAAA........
..CCCCCCCCCCCCC...IIIIIIIIIIIII...AAAAAAAAAA......
....PPP............................AAAAAAAAAA.....
MMMMPPPMMMMMMMMMMMMMMM.............AAAAAAAAAAA....
MMMMPPPMMMMMMMMMMMMMMM..............AAAAAAAAAAA...
MMMMMMMMMMMMMMMMMMMMMM...............AAAAAAAAAA...
MMMMMMMMMMMMMMMMMMMMMM...............AAAAAAAAAA...
MMMMMMMMMMMMMMMMMMMMMM............................

Expected output:
SAFE
SAFE
SAFE
SUSPICIOUS
SUSPICIOUS
SUSPICIOUS
Problem p01128 test case
Input:
2
-10 1 10 1
4
-6 2 -2 -2 0 1
-6 -2 -2 2 1 0
6 2 2 -2 0 0
6 -2 2 2 1 1
8 12 -7 -3
8
4 -5 4 -2 1 1
4 -2 4 9 1 0
6 9 6 14 1 1
-7 6 7 6 0 0
1 0 1 10 0 0
-5 0 -5 10 0 1
-7 0 7 0 0 1
-1 0 -1 -5 0 1

Expected output:
1
3
Problem p01129 test case
Input:
5 2
5000
10 20 0 30 5
10 1000 6 1
20 500 8 1
3 40 25 30
0 0

Expected output:
50 84.000
Problem p01130 test case
Input:
4 5 1 3 4
1 2 5
2 3 5
2 4 5
1 3 8
1 4 8
0 0 0 0 0

Expected output:
15
Problem p01131 test case
Input:
5
20
220
222220
44033055505550666011011111090666077705550301110
000555555550000330000444000080000200004440000

Expected output:
a
b
b
hello, world!
keitai
Problem p01132 test case
Input:
160
1 1 2 0
160
1 0 2 10
0

Expected output:
10 1
50 1
100 1

10 1
100 2
Problem p01133 test case
Input:
2 0 0 10 10
1 1
4 4
2 0 0 10 10
1 1
6 6
2 0 0 10 10
1 1
5 5
0 0 0 0 0

Expected output:
YES
NO
NO
Problem p01134 test case
Input:
2
-100 -20 100 20
-20 -100 20 100
2
-100 -20 -20 -100
20 100 100 20
0

Expected output:
4
3
Problem p01135 test case
Input:
4 5
1 2 10
1 3 15
2 3 5
2 4 3
3 4 10
2
1 4 10 LoveLetter
2 3 20 Greetings
3 3
1 2 1
2 3 1
3 1 1
3
1 2 1 BusinessMailC
2 3 1 BusinessMailB
3 1 1 BusinessMailA
0 0

Expected output:
Greetings 25
LoveLetter 33

BusinessMailA 2
BusinessMailB 2
BusinessMailC 2
Problem p01136 test case
Input:
4
1 1
2 2 3
2 1 2
3 3 4 5
0

Expected output:
3
Problem p01137 test case
Input:
1
2
4
27
300
1250
0

Expected output:
1
2
2
3
18
44
Problem p01138 test case
Input:
3
05:47:15 09:54:40
12:12:59 12:13:00
16:30:20 21:18:53
6
00:00:00 03:00:00
01:00:00 03:00:00
02:00:00 03:00:00
03:00:00 04:00:00
03:00:00 05:00:00
03:00:00 06:00:00
0

Expected output:
1
3
Problem p01139 test case
Input:
10 10
.....W....
....W.W...
...W...W..
....W...W.
.....W...W
......W.W.
BBB....W..
..B..BBBBB
..B..B....
..B..B..W.
5 3
...B.
...BB
.....
1 1
.
0 0

Expected output:
6 21
12 0
0 0
Problem p01140 test case
Input:
3 3
1
1
4
2
3
1
1 2
10
10
10
0 0

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

Expected output:
108.0
96.63324958071081
103.2664991614216
60.0
Problem p01142 test case
Input:
5 3
#####
#K.M#
#####
9 5
#########
#.....###
#.###..M#
#K#######
#########
9 5
#########
#K......#
####.####
####M####
#########
9 5
#########
#M......#
####.####
####K####
#########
7 9
#######
#####M#
#####.#
#.....#
#.###.#
#.....#
#.#####
#K#####
#######
7 6
#######
#####.#
##....#
#K..#.#
###M#.#
#######
7 8
#######
##...##
###.#M#
#.....#
#.#...#
#.#..##
#.K####
#######
9 6
#########
###..##.#
##......#
#K....#.#
##..#M#.#
#########
9 6
#########
#.#######
#....#M.#
#.#...#.#
###K#...#
#########
12 7
############
###...####.#
##K#...M##.#
##.....#...#
#........#.#
###..#...#.#
############
23 16
#######################
#########...###########
##########.###.########
##########.....########
##########.#.#.###...##
########.#.#.######.###
########............###
########.###.######.###
############.######.###
#K...........######.###
####.#######.######.###
####.#######.######.###
####.................M#
####.#######.##########
###...#####...#########
#######################
46 16
##############################################
#..............#..############################
#..#..........#.#.###....#...................#
#.................###.#.#.#...............#..#
#...#..#....#...#.###.#......................#
#...#....#....#.#.###.#.#...#....#....#..#...#
#.#........#..........#.#.#....#....#....#...#
#...#...#.......###.#........#.........#...#.#
#.#...#.........###.#..##.......#........#...#
#...#........#..###.#..##.........#........#.#
#...............###.#..##..#.........#...#...#
############.######.#..##....................#
###########K...........#.########.############
###################...............M###########
##################.......#####################
##############################################
0 0

Expected output:
He can accomplish his mission.
He can accomplish his mission.
He cannot bring tea to his master.
He cannot return to the kitchen.
He can accomplish his mission.
He can accomplish his mission.
He cannot return to the kitchen.
He cannot return to the kitchen.
He can accomplish his mission.
He can accomplish his mission.
He cannot return to the kitchen.
He can accomplish his mission.
Problem p01143 test case
Input:
3 2 50
1
2
3
4 4 75
1
2
3
0
3 1 10
8
1
1
0 0 0

Expected output:
150
0
112
Problem p01144 test case
Input:
2 8
5 6
4 5
3 1
5 10
5 10
5 10
0 0

Expected output:
5
140
Problem p01145 test case
Input:
kusa
haha
hakata
kippu
sasakisan
sosonokasu
hottokouhii
i
#

Expected output:
k(u)sa
h(a)ha
h(a)kata
k(i)ppu
s(a)sak(i)san
s(o)sonokas(u)
hott(o)kouhii
i
Problem p01146 test case
Input:
2 1 0 1 0 1
0 1 2
3 1 1 2 0 1
2
0 2 1
1 2 1
3 2 1 2 0 1
2
0 2 1
1 2 1
4 4 1 4 1 3
2
0 1 2
1 2 4
0 2 1
3 0 3
5 3 2 6 0 3
1 2
2 1 2
1 0 1
3 4 1
2 4 1
4 1 2
2 0 2
5 4 2 6 0 3
1 2
4 2 4
2 1 2
4 3 1
0 1 5
1 4 2
2 0 3
0 0 0 0 0 0

Expected output:
Help!
3
2
10
5
12
Problem p01147 test case
Input:
4
apple
length
things
thin
2
icp
cpc
3
zeta
eta
alphabet
2
until
till
0

Expected output:
applengthings
icpc
zetalphabet
untill
Problem p01148 test case
Input:
4 1 1
1 1
1 2
-1 2
-1 1
2 1 0
0 1 0 1 2
0 0 0

Expected output:
1
1.000
Problem p01149 test case
Input:
4
5 4
9 2 8 3 7 4 6 5
A J
K Q J T 9 8 7 6
T 4
7 J A 6 Q T K 7
2 2
2 3 4 K 2 3 4 K

Expected output:
18
blackjack
21
bust
Problem p01150 test case
Input:
8
16
17
0

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

Expected output:
3 3 1 7 2
No
Problem p01152 test case
Input:
5
3 C E G
3 C E G#
4 C A G E
5 F A C E D
3 C D E

Expected output:
C Em(+5)
C(+5) E(+5) G#(+5)
C(13) Am7 Am(+13)
Dm7(9) FM7(13)
UNKNOWN
Problem p01153 test case
Input:
2
4 0 1 2 3
6 1 8 0 3 5 9

Expected output:
6
34
Problem p01154 test case
Input:
4
0 0
2 0
2 2
0 2
1 1
6
2 2
2 5
0 5
0 0
5 0
5 2
1 4
0

Expected output:
0.000
3.000
Problem p01155 test case
Input:
33 40
57 144
0 0

Expected output:
22
94
Problem p01156 test case
Input:
8
Lightning
Gun
Paper
Sponge
Water
Dragon
Devil
Air
3
Rock
Scissors
Paper
0

Expected output:
Sponge
Draw
Problem p01157 test case
Input:
3 2
1 2 10
3
0 3420 o
1 4589 o
2 4638 x
3
1 6577 SUZUMIYA
2 7644 SUZUMIYA
0 19979 YASUZUMI
4 2
150 150 150 150
4
0 1344 HOGEHOGE
1 1466 HOGEHOGE
2 1789 HOGEHOGE
3 19100 GEHO
2
2 1200 SETTEN
3 700 SETTEN
0 0

Expected output:
177 57
19 58
19 57
19 62

253 70
13 58
13 58
24 66
20 71
Problem p01158 test case
Input:
3
gu 20 pa 10
ci 20 gu 10
pa 20 ci 10
2
tool 20 tool 10
product 1000 tool 10
8
fishhook  21 disk     3
mill      14 axe      7
boomerang 56 sundial 28
flint     35 fishhook 5
axe       35 flint   14
disk      42 disk     2
sundial   14 disk     7
hammer    28 mill     7
0

Expected output:
40
30
113
Problem p01159 test case
Input:
3 1
0 0
1 1
2 0
11 1.5
0 0
2 7
5 3
7 8
10 -5
13 4
15 -1
17 3
20 -7
23 9
24 0
0 0

Expected output:
0.166666666666667
165.213541666667
Problem p01160 test case
Input:
YMAOKDOAMIMHAADAMMA
LELVEEL

Expected output:
MADAMIMADAM
LEVEL
Problem p01161 test case
Input:
4 4
2 2 2
2 2 2
99 1 0
1 99 1
1 99 1
1 99 1
1 99 1
1 99 1
1 99 1
99 1 0
99 1 0
1 99 1
1 99 1
1 99 1
1 99 1
1 99 1
1 99 1
99 1 0
1 0
1 6
2 2
10
10
5 5 0
5 5 0
5 5 0
5 5 0
5 0
5 10
0 0

Expected output:
28
25
Problem p01162 test case
Input:
4
0 4 2 4
0 2 2 0
3 0 4 2
6 2 6 0
0

Expected output:
8.0000
Problem p01163 test case
Input:
10
12
15
777
4999
5000
0

Expected output:
0
1
2
110
2780
0
Problem p01164 test case
Input:
4
WBWB
BWBW
8
WWWWBWBB
WWBBWBWW
0

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

Expected output:
3
1
2
2
7
18
Problem p01166 test case
Input:
3 1
1 09:00 3 10:00
3
1 09:10
2 09:30
3 09:40
3 2
1 09:00 1 10:00
3
1 09:10
2 09:30
3 09:40
3
3 09:20
2 09:30
1 10:00
1 0
1 09:00 1 10:00
1 0
1 10:00 1 09:00
3 1
1 09:00 3 09:35
3
1 09:10
2 09:30
3 09:40
4 3
1 09:00 4 11:00
3
1 09:10
2 09:20
4 09:40
3
1 10:30
3 10:40
4 10:50
4
1 08:50
2 09:30
3 10:30
4 11:10
0 0

Expected output:
30
30
0
impossible
impossible
60
Problem p01167 test case
Input:
czujthebdgfoliskax
bdgchuptzefliskaox
fox
fennec
oinarisama
xiaorong
customizedrevisedfoooox
accurateredundantfooooooooox
fox
*

Expected output:
cutefox
Impossible
cuteredfox
Problem p01168 test case
Input:
23 18 53
46 30 47
-1 -1 -1

Expected output:
49
-1
Problem p01169 test case
Input:
5 4
0 0 20 0 20 10 0 10 1 5
10 3 12 5 10 7 8 5
10 5
4 3
0 0 10 0 10 5 0 5
3 1 6 1 5 4
0 0
5 3
0 0 10 0 10 10 0 10 3 5
1 1 4 1 4 6
0 0
0 0

Expected output:
360.0000000
12.6803835
3.3722867
Problem p01170 test case
Input:
2
1.0 0.0
0.5
0.0 0.0 1
2.0 0.0 -1
2
1.0 0.0
0.5
0.0 0.0 -1
2.0 0.0 1
0

Expected output:
0.500000
SAFE
Problem p01171 test case
Input:
10 15
30 20
0 0

Expected output:
a
b
Problem p01172 test case
Input:
1 3
1 6
3 5
2 200
25 99
0 0

Expected output:
0 1
1 1
1 0
2 0
0 2
Problem p01173 test case
Input:
3
2 1
0 0
50 50
100 0
3
1 1
0 0
50 50
100 0
3
1 2
0 0
50 50
100 0
3
2 1
0 0
100 100
150 50
6
1 2
0 0
50 50
100 0
150 0
200 50
250 0
0

Expected output:
70.710678
100.000000
50.000000
106.066017
150.000000
Problem p01174 test case
Input:
3
0.0 0.0
1.0 1.0
0.0 1.0
3.0 3.0
2.0 2.0
3.0 2.0
0

Expected output:
3.14159265359
Problem p01175 test case
Input:
3
R2R2
R1R2R4R8R16R32R64
R1R4R16

Expected output:
R1
R1......
R16R1R4
Problem p01176 test case
Input:
2 1
0 1
0 0
2 1
0 0
1 0
3 3
0 1 1
0 0 1
0 0 0
3 3
0 1 0
0 0 0
1 1 0
3 1
0 1 0
0 0 0
1 1 0
3 3
0 1 0
0 0 1
1 0 0
6 4
0 0 0 0 0 1
1 0 1 0 1 0
1 0 0 1 1 0
1 1 0 0 1 0
1 0 0 0 0 0
0 1 1 1 1 0
7 2
0 1 0 0 0 1 0
0 0 1 0 1 1 1
1 0 0 1 1 0 0
1 1 0 0 0 1 0
1 0 0 1 0 0 1
0 0 1 0 1 0 0
1 0 1 1 0 1 0
8 6
0 0 0 0 1 0 0 0
1 0 1 1 0 0 0 0
1 0 0 0 1 0 0 0
1 0 1 0 0 1 0 1
0 1 0 1 0 0 1 0
1 1 1 0 1 0 0 1
1 1 1 1 0 1 0 0
1 1 1 0 1 0 1 0
0 0

Expected output:
1
0
0
3
0
1
11
139
78
Problem p01177 test case
Input:
3 2 3
10 2 1 2
20 2 3 2
1
2
3
5 2 5
10 3 1 2 4
20 3 2 3 5
1
2
3
4
5
4 1 4
10 2 1 4
1
2
3
4
4 3 4
30 2 1 4
20 2 2 4
10 2 3 4
1
2
3
4
4 3 4
10 2 1 4
20 2 2 4
30 2 3 4
1
2
3
4
4 3 4
10 2 1 2
15 2 1 4
20 2 2 3
1
2
3
4
3 2 3
10 2 2 3
20 2 1 2
1
2
3
1 0 1
1
0 0 0

Expected output:
1
2
3

1
2
3
5
4

1
4
2
3

1
4
2
3

1
2
3
4

1
4
2
3

1
2
3

1
Problem p01178 test case
Input:
1 4 100
7
10 1 50 50
15 2 50 50
25 1 50 50
35 3 50 50
1 2 100
5
30 3 20 50
40 4 40 50
1 2 100
5
49 3 20 50
60 4 50 30
1 2 100
5
50 3 20 50
60 4 50 30
2 3 100
4 2
10 4 20 20
30 2 20 20
40 4 20 20
0 0 0

Expected output:
0.7428571428571429
0.4285714285714285
0.5542857142857143
-0.1428571428571428
0.8000000000000000
Problem p01179 test case
Input:
7
C is A’s father’s brother’s son’s aunt
C is A’s mother’s brother’s son’s aunt
C is A’s son’s mother’s mother’s son
C is A’s aunt’s niece’s aunt’s niece
C is A’s father’s son’s brother
C is A’s son’s son’s mother
C is A

Expected output:
5 3
5 1
2 2
6 0
2 0
1 1
0 0
Problem p01180 test case
Input:
4
1.0 0.0 0.0
1.5 0.0 3.0
2.0 4.0 0.0
1.0 3.0 4.0
0

Expected output:
0.5
Problem p01181 test case
Input:
3 1 6 8 10 7 0 0 2 5
0 0 0 0 0 0 0 0 0 1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1

Expected output:
2
362880
Problem p01182 test case
Input:
5 4
Ramen 3 10
Chahan 5 5
Gyoza 5 10
Rice 1 1
Soup 1 1
5 2 Ramen Gyoza
10 6 Chahan Gyoza Soup Ramen Gyoza Rice
20 1 Chahan
25 1 Ramen
0 0

Expected output:
25
42
40
35
Problem p01183 test case
Input:
7 1 2 2 2 2 2 2
0

Expected output:
0.942809
Problem p01184 test case
Input:
3 4
English
French
Japanese
1 English
2 French English
2 Japanese English
1 Japanese
2 2
English
Japanese
1 English
1 Japanese
6 7
English
Dutch
German
French
Italian
Spanish
1 English
2 English Dutch
2 Dutch German
2 German French
2 French Italian
2 Italian Spanish
1 Spanish
0 0

Expected output:
2
English
Japanese

Impossible

Impossible
Problem p01185 test case
Input:
2
0 0 3 3
0 4 3 1
1 1
0

Expected output:
4.243
Problem p01186 test case
Input:
4
OmoikkiriTV 12:00 13:00 5 1
WaratteIitomo 12:00 13:00 10 2
WatarusekennhaOnibakari 20:00 21:00 10 3
SuzumiyaharuhiNoYuuutsu 23:00 23:30 100 40
5
a 0:00 1:00 100 100
b 0:00 1:00 101 101
c 0:00 1:00 102 102
d 0:00 1:00 103 103
e 0:00 1:00 104 104
0

Expected output:
121
207
Problem p01187 test case
Input:
3
3 1 3 5
2 1 4
4 1 2 3 6
1 3
0

Expected output:
2
Problem p01188 test case
Input:
3
10 30
......#############...........
....##_____________#..........
...#________________####......
..#________####_________#.....
.#________#....##________#....
#_________#......#________#...
#__________###...#_____^^_#...
.#__________A_#...#____^^_#...
..#___________#...#_>__###....
...###########.....####.......
7 17
......#..........
.....#_##........
.#...#_A_#.......
#^####___#.......
#_______#........
#>_____#.........
########.........
6 5
#####
#_A_#
#___#
#_>_#
#___#
#####

Expected output:
2
1
0
Problem p01189 test case
Input:
2
0 -12 0 0 2
0 0 12 0 2
0

Expected output:
39.14159
Problem p01190 test case
Input:
4
a list of A, B, C and D
a list of A, a list of P and Q, B, a list of X, Y and Z and C
a list of A
a list of a list of A and B

Expected output:
(A B C D)
(A (P Q) B (X Y Z) C)
(A)
AMBIGUOUS
Problem p01191 test case
Input:
2
1 2
1
42 3.141592653589793
5 20
3
0 307.09242465218927
180 307.09242465218927
90 728.30573874452591

Expected output:
2.0 3.141592653589793
8.660254038 5.235987756
Problem p01192 test case
Input:
3 1 5 25
3 7 77 777
4 1 8 27 64
0

Expected output:
Case #1: OK
Case #2: Cannot pay some amount
Case #3: Cannot use greedy algorithm
Problem p01193 test case
Input:
1+2+3+4+5+6+7+8+9+10=
1000-500-250-125=
1*2*3*4*5*6=
5000*5000=
10-100=
100*100=
10000=

Expected output:
55
125
720
E
E
E
E
Problem p01194 test case
Input:
5 1
2 1 3 2
2 1 2 2
0 0

Expected output:
4.18
Problem p01195 test case
Input:
3
philosopher’s-stone
4 10
tongue 1
tear 1
dunkelheit 1
aroma-materia 1

aroma-materia
4 5
solt 1
holy-water 1
golden-rock 1
neutralizer 2

neutralizer
1 1
red-rock 5

7
tongue 1
tear 1
dunkelheit 1
solt 2
holy-water 3
golden-rock 2
red-rock 10

2
philosopher’s-stone
5 3
ninjin 1
jagaimo 3
tamanegi 1
barmont 12

barmont
3 1
curry 5
komugiko 20
batar 10

7
ninjin 3
jagaimo 2
tamanegi 5
curry 150
komugiko 750
batar 200

0

Expected output:
16
impossible
Problem p01196 test case
Input:
4 4
3 3 5 3
3 5 5 6
4 4
3 3 5 3
3 5 5 5
0 0

Expected output:
4
TOO MANY
Problem p01197 test case
Input:
2

3 3
0 2
0 2 240 80
0 1 130 60
1 2 260 60

3 3
0 2
0 2 180 60
0 1 130 60
1 2 260 60

Expected output:
3.2500
3.0000
Problem p01198 test case
Input:
1
3
2 4 6
4
10 100
2 3
10 6
7 6

Expected output:
crash
try again
good 1.000
perfect
Problem p01199 test case
Input:
1 0 1
51
50
2 1 1
1 2 1
1000 0
0 1000
4 3 5
1 2 4
1 3 1
3 4 2
0 1000 1000 1000
3000 0 0 0

Expected output:
50
0
3000
Problem p01200 test case
Input:
2 3
10.00
3 10 10 20 10 10 20
4 30 10 40 10 40 20 30 20
1.00 3 0 0 10 0 0 10
0.50 4 20 15 25 15 25 20 20 20
0.75 6 40 35 50 40 40 50 30 50 25 45 30 40
4 1
5.00
3 0 0 24 0 0 24
3 50 0 50 24 26 0
3 0 50 0 26 24 50
3 50 50 26 50 50 26
1.00 4 25 0 50 25 25 50 0 25
0 0

Expected output:
35.4
5.6

133.3
133.3
133.3
133.3
Problem p01201 test case
Input:
push 1
push 2
sqrt
div
push 1
push 3
sqrt
div
add
disp
push 8
sqrt
push 3
push 2
sqrt
mul
add
disp
stop

Expected output:
1/2*sqrt(2) + 1/3*sqrt(3)
5*sqrt(2)
Problem p01202 test case
Input:
3
UU
RDUL
ULDURDULDURDULDURDULDURD

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

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

Expected output:
1.414
2.000
3.000
Problem p01205 test case
Input:
4 4
4 3 2 2
4 4
4 3 2 3
0 0

Expected output:
1111001
Goofy
Problem p01206 test case
Input:
4 4 1 1
2 2 2 2
2 1 1 2
2 1 1 2
2 1 2 2
1 1
4 4 1 1
2 2 2 2
2 1 1 2
2 1 1 2
2 1 2 2
2 2
4 4 1 1
2 2 2 2
2 1 1 2
2 1 1 2
2 1 1 2
1 1
3 6 6 1
1 6 7 1 7 1
5 1 2 8 1 6
1 4 3 1 5 1
1 4
5 6 21 1
1 3 3 3 3 1
3 1 1 1 1 3
3 1 1 3 2 2
3 1 1 1 1 3
1 3 3 3 3 1
3 4
0 0 0 0

Expected output:
Yes
No
No
No
Yes
Problem p01207 test case
Input:
2
1234 3 0
1245 3 0
1
1234 0 0
2
0123 0 4
1230 0 4
0

Expected output:
1235
????
0132
Problem p01208 test case
Input:
2 1
KarasumaKitaoji 0 6150
KarasumaNanajo 0 0
KarasumaNanajo KarasumaKitaoji
KarasumaKitaoji KarasumaNanajo
3 2
KujoOmiya 0 0
KujoAburanokoji 400 0
OmiyaNanajo 0 1150
KujoOmiya KujoAburanokoji
KujoOmiya OmiyaNanajo
KujoAburanokoji OmiyaNanajo
10 12
KarasumaGojo 745 0
HorikawaShijo 0 870
ShijoKarasuma 745 870
ShijoKawaramachi 1645 870
HorikawaOike 0 1700
KarasumaOike 745 1700
KawaramachiOike 1645 1700
KawabataOike 1945 1700
KarasumaMarutamachi 745 2445
KawaramachiMarutamachi 1645 2445
KarasumaGojo ShijoKarasuma
HorikawaShijo ShijoKarasuma
ShijoKarasuma ShijoKawaramachi
HorikawaShijo HorikawaOike
ShijoKarasuma KarasumaOike
ShijoKawaramachi KawaramachiOike
HorikawaOike KarasumaOike
KarasumaOike KawaramachiOike
KawaramachiOike KawabataOike
KarasumaOike KarasumaMarutamachi
KawaramachiOike KawaramachiMarutamachi
KarasumaMarutamachi KawaramachiMarutamachi
KarasumaGojo KawabataOike
8 9
NishikojiNanajo 0 0
NishiojiNanajo 750 0
NishikojiGojo 0 800
NishiojiGojo 750 800
HorikawaGojo 2550 800
NishiojiShijo 750 1700
Enmachi 750 3250
HorikawaMarutamachi 2550 3250
NishikojiNanajo NishiojiNanajo
NishikojiNanajo NishikojiGojo
NishiojiNanajo NishiojiGojo
NishikojiGojo NishiojiGojo
NishiojiGojo HorikawaGojo
NishiojiGojo NishiojiShijo
HorikawaGojo HorikawaMarutamachi
NishiojiShijo Enmachi
Enmachi HorikawaMarutamachi
HorikawaGojo NishiojiShijo
0 0

Expected output:
2
impossible
13
4
Problem p01209 test case
Input:
10 500
16 A
0 0

Expected output:
124
2
Problem p01210 test case
Input:
1
SA
1
C2
2
SA HA
2
C2 C3
5
S3 S5 S8 S9 S2
3
H7 H3 H4
10
H7 CJ C5 CA C6 S2 D8 DA S6 HK
10
C2 D6 D4 H5 DJ CX S8 S9 D3 D5
0

Expected output:
A wins.
B wins.
B wins.
A wins.
Problem p01211 test case
Input:
3 2 1
3 2 0
0 0 0

Expected output:
13.36
6.28
Problem p01212 test case
Input:
8 3
########
#<A.@.a#
########
8 3
########
#<AaAa@#
########
8 4
########
#<EeEe@#
#FG.e#.#
########
8 8
########
#mmm@ZZ#
#mAAAbZ#
#mABBBZ#
#mABCCd#
#aABCDD#
#ZZcCD<#
########
0 0

Expected output:
7
-1
7
27
Problem p01213 test case
Input:
ABCABCABAB
ZZZZZZZZZZZZ
#END

Expected output:
ABAB
ZZZZZZ
Problem p01214 test case
Input:
5
4 4
....
....
####
....
12 8
........
........
........
........
........
.......#
##.##..#
.#######
.#######
.#######
.#######
.####.#.
4 4
....
....
.###
...#
12 8
........
........
........
........
........
........
........
##...###
##.#####
#######.
#######.
#######.
4 4
####
#..#
#..#
####
12 8
........
........
........
........
........
.......#
##.##..#
##....##
##.##.##
##.##.##
##....##
.####.#.
2 2
##
#.
3 3
.##
.##
##.
4 4
....
.##.
.##.
....
2 2
..
..

Expected output:
4
1
4
-1
2
Problem p01215 test case
Input:
3
1
120 1000
100 100 180 20
170 10 270 30
270 40 400 20
0

Expected output:
403.87458314