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

Expected output:
48
7
1
Problem p02041 test case
Input:
4
6 4 7 8

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

Expected output:
12
Problem p02043 test case
Input:
4 4 10
100 100 100 100
100 100 100 100
1 100 100 1
1 1 1 1

Expected output:
970
Problem p02044 test case
Input:
3 300
120 100 80
3 30
10 20 5
4 1000
100 200 300 400
5 5
2523 8430 3 4199 632
0 0

Expected output:
280
25
800
5
Problem p02045 test case
Input:
2
3 3 5 7
3 3
7 3
7 7
5
1 10 100 10
1 1
100 1
50 20
50 80
51 21
51 1
0

Expected output:
5
174
Problem p02046 test case
Input:
2 0
2 2
1 -1
0 0
0 -5
173 207

Expected output:
2
4
1
0
6
379
Problem p02047 test case
Input:
typewriter
periodicity
100010
100100
101000
110000
periodicity
typewriter
100010
100100
101000
110000
periodicity
typewriter
100010
100100
101000
1
domestic
contest
100010
100100
101000
110000
#

Expected output:
823120
1001540
603217
502210
Problem p02048 test case
Input:
3 3
1 2 3
2 1 3
3 3 3
8 5
3 3 4 3 4
2 1 2 3 2
7 9 7 8 7
3 4 3 3 4
1 2 2 3 2
4 5 6 5 6
7 9 7 7 8
4 5 5 6 6
5 5
1 2 3 4 5
2 3 4 5 1
3 4 5 1 2
4 5 1 2 3
5 1 2 3 4
5 9
1 1 1 1 1 1 1 1 1
2 2 2 2 2 2 2 2 2
3 3 3 3 3 3 3 3 3
4 4 4 4 4 4 4 4 4
5 5 5 5 5 5 5 5 5
0 0

Expected output:
2
3
1
9
Problem p02049 test case
Input:
MI2(2SI)2PI
ISSI
100(100(JAG))
JAG
1000000000000000000A
AAAAA
#

Expected output:
2
10000
999999999999999996
Problem p02050 test case
Input:
5 2
1 1
1 4
2 2
3 1
3 5
3 1
0 2
1 0
-1 0
3 2
0 2
1 0
-1 0
9 10
8 1
9 19
2 10
1 1
4 17
7 13
3 4
6 13
9 21
0 0

Expected output:
11.812559200041266
6.472135954999580
-1
52.202878812480016
Problem p02051 test case
Input:
4 9
1 2 1
1 2 2
1 3 1
1 3 2
1 3 3
2 3 1
2 3 2
1 4 1
3 4 2
8
1 5
2 5
3 5
4 5
1 1234567
2 1234567
3 1234567
4 1234567
4 8
1 2 1
1 2 1
1 2 3
3 4 3
1 4 2
2 4 1
2 4 3
2 4 3
8
1 3
2 6
3 8
4 12
1 31415926
2 53589793
3 23846
4 26433832
0 0

Expected output:
1
9
37
21
1
2469133
307629943
60012504
1
16
0
424
1
160769377
0
43581113
Problem p02052 test case
Input:
3 3
B.B
..B
.BB

Expected output:
4
Problem p02053 test case
Input:
3 3
B.B
..B
.BB

Expected output:
4
Problem p02054 test case
Input:
1 1 10

Expected output:
Hom
Problem p02055 test case
Input:
3 2
1 3 2

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

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

Expected output:
9
Problem p02058 test case
Input:
3 2
1 2
1 3

Expected output:
5
Problem p02059 test case
Input:
?MG?

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

Expected output:
6
Problem p02061 test case
Input:
3
43
9
24

Expected output:
11
0
5
Problem p02062 test case
Input:
?&?|?&?|?&?

Expected output:
3 2
Problem p02063 test case
Input:
4 6

Expected output:
8
Problem p02065 test case
Input:
3 2 7

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

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

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

Expected output:
2
Problem p02080 test case
Input:
3
dea
xxx
abcd

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

Expected output:
1
Problem p02082 test case
Input:
0 15656
3 7 13333
0

Expected output:
15656
Problem p02083 test case
Input:
2 1
2 1 2

Expected output:
1
Problem p02084 test case
Input:
1
0 500000

Expected output:
1
Problem p02085 test case
Input:
1

Expected output:
0
Problem p02086 test case
Input:
zaki
o
4

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

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

Expected output:
2
Problem p02089 test case
Input:
3 3 3 10
1 -2 3
1 2 2 3
2 20 1 3
2 1 20 5

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

Expected output:
2
Problem p02091 test case
Input:
2 6 1 5

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

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

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

Expected output:
1
Problem p02095 test case
Input:
2 10
1 2
1 9
8 7

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

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

Expected output:
Yes
2 6 3 7
4 5 2 1
1 7 5 6
5 3 4 2
Problem p02098 test case
Input:
10
20

Expected output:
15.0
Problem p02099 test case
Input:
3
1.000
3.000
3.000

Expected output:
0
4
4
Problem p02100 test case
Input:
x^2+3x+2

Expected output:
(x+1)(x+2)
Problem p02101 test case
Input:
3 10
1 6
5 10
0 5

Expected output:
2
Problem p02102 test case
Input:
4 5
0 2 22 13
0 3 15 25
1 2 3 3
1 3 28 5
2 3 5 22

Expected output:
0.36000
Problem p02103 test case
Input:
3 5 2
0 2
2 2

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

Expected output:
1
2
3
4
5
Problem p02105 test case
Input:
7 10 11
1 1 0
1 0 1
2 2 2
3 3 5
4 1 3
5 1 3
5 5 -1

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

Expected output:
7
7
3
Problem p02107 test case
Input:
3 3
1 2 3
2 1 2
3 2 1

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

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

Expected output:
8
Problem p02110 test case
Input:
3 2
2 1
1 2
1 3

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

Expected output:
0 0
Problem p02112 test case
Input:
1
1 1 359 1

Expected output:
0
Problem p02113 test case
Input:
4 2
oi
io
rr
rr

Expected output:
iorrrroi
Problem p02114 test case
Input:
5
oxooo
oxooo
oxooo
xxxxx
oxooo

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

Expected output:
2
Problem p02116 test case
Input:
2

Expected output:
1
Problem p02117 test case
Input:
1 10 10
3
1 10 1
2 20 2
3 30 3
0

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

Expected output:
25
Problem p02119 test case
Input:
3
0
0
2

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

Expected output:
44
25
42
30
40
39
30
37
36
Problem p02121 test case
Input:
2 1
0 0 5 5
3 3 6 6
2 2

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

Expected output:
7
2
2
8
1
Problem p02123 test case
Input:
5
oxooo
oxooo
oxooo
xxxxx
oxooo

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

Expected output:
ai1333
Problem p02125 test case
Input:
2

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

Expected output:
110
Problem p02127 test case
Input:
AABABCAC
A

Expected output:
2
Problem p02128 test case
Input:
10 10 1
6 6

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

Expected output:
yes
Problem p02130 test case
Input:
5 3 5
7 2
13 1
1 1
2 9
2 4

Expected output:
4
Problem p02131 test case
Input:
2 3
00

Expected output:
0
Problem p02132 test case
Input:
5 2
0 0
5 5
10 10
100 100
200 200

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

Expected output:
4 1
9 1
1 1
1 1
2 2
12 1
Problem p02134 test case
Input:
0 0
13 33
2
0 34
14 0

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

Expected output:
13
27
12
Problem p02136 test case
Input:
2
-1 -1 10
1 1 1

Expected output:
0
1
Problem p02137 test case
Input:
5700

Expected output:
5500
Problem p02138 test case
Input:
20 10

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

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

Expected output:
2 8
Problem p02141 test case
Input:
6000 5000 20 10 400 300

Expected output:
0.75
Problem p02142 test case
Input:
2 1 1 2
1 2 1 100

Expected output:
19
Problem p02143 test case
Input:
5 3
1 4
3 7
0 1000

Expected output:
7
10
9
5
8
Problem p02144 test case
Input:
2
1 1
0

Expected output:
1
Problem p02145 test case
Input:
5
you
ate
my
hum
toast

Expected output:
e
t
u
Problem p02146 test case
Input:
5
4 0 4 0 0
1 2
1 3
1 4
2 5

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

Expected output:
1.414213562373
Problem p02148 test case
Input:
3 3
0 2
1 2
1 1 0 0 1
0 0 2
0 0 1

Expected output:
3
3
Problem p02149 test case
Input:
1000 900 850

Expected output:
A
Problem p02150 test case
Input:
3 1 5

Expected output:
7
Problem p02151 test case
Input:
10
1236547896

Expected output:
123
456
789
Problem p02152 test case
Input:
2
5 3

Expected output:
2.83333333
Problem p02153 test case
Input:
4 4 1 1
g#..
#...
.*..
...s

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

Expected output:
3.04720672
Problem p02155 test case
Input:
1 1
2

Expected output:
First
Problem p02156 test case
Input:
3 1
RRL
5 5 1
3 1 10

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

Expected output:
0
0
Problem p02158 test case
Input:
100 5
50 1 5
50 5 10
50 20 30
50 40 60
50 61 1000000

Expected output:
48.6090201099
Problem p02159 test case
Input:
2
1 2

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

Expected output:
0
1
0
Problem p02161 test case
Input:
12 3
itisansansan
1 12
5 12
6 7

Expected output:
2
1
0
Problem p02162 test case
Input:
9 8 1000 999

Expected output:
Alice
Problem p02163 test case
Input:
3
1 2
2 10
3 8

Expected output:
-2 2
Problem p02164 test case
Input:
2
0 1
0 -1

Expected output:
450.00000000
Problem p02165 test case
Input:
8 5
_###_
_#_B#
_####
____#
###_#
#####
###_#
####_

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

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

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

Expected output:
mo3tthi
Problem p02169 test case
Input:
2 10 1

Expected output:
1024
Problem p02170 test case
Input:
1 1 50

Expected output:
1
Problem p02171 test case
Input:
abab
5 5
2 2 4
1 1 5 abab
2 3 5
1 3 3 a
2 1 5

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

Expected output:
440
Problem p02173 test case
Input:
2 1
1 1 1
2 2 2
1 2

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

Expected output:
64
Problem p02175 test case
Input:
10 30 10
3
nobiro
nobiro
tidime

Expected output:
80
Problem p02176 test case
Input:
5
ANazA

Expected output:
1
A
Problem p02177 test case
Input:
5 2
1 2
2 1

Expected output:
1 2
1 2
3
4
5
Problem p02178 test case
Input:
4 10 1 4
1 2 52
1 3 68
3 4 45

Expected output:
Yes
Problem p02179 test case
Input:
2
5 10 5 5
4 4 2 2

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

Expected output:
2
1
2
Problem p02181 test case
Input:
2
AORA
OR

Expected output:
2
Problem p02182 test case
Input:
2 3
..#
##.
.##
#..

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

Expected output:
Yes
Yes
Problem p02184 test case
Input:
2
1000000007

Expected output:
1000000009
Problem p02185 test case
Input:
73
6?

Expected output:
645
Problem p02186 test case
Input:
5 2
1 2 -3 4 -5
3 3
2 -6

Expected output:
4
10
7
Problem p02187 test case
Input:
abracadabra
cadabra
4

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

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

Expected output:
4
Problem p02190 test case
Input:
6
8 6 9 1 2 1

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

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

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

Expected output:
6
9
2
4
Problem p02194 test case
Input:
6
8 6 9 1 2 1

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

Expected output:
5
1
Problem p02196 test case
Input:
2 2
14 86 9 121
3 34 3 34
1 14 5 14
1 9 1 9

Expected output:
No
Yes
Problem p02198 test case
Input:
3 4

Expected output:
12
Problem p02199 test case
Input:
14 86
9 1 20

Expected output:
119.428571428571
Problem p02200 test case
Input:
5
8 6 9 1 20

Expected output:
2
Problem p02201 test case
Input:
5
E869120
TMJN
E869120
TAISA
YNYMXIAOLONGBAO

Expected output:
2
Problem p02202 test case
Input:
1
59549

Expected output:
59548
Problem p02203 test case
Input:
5
8 6 9 1 20

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

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

Expected output:
-4 3
Problem p02206 test case
Input:
1 1

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

Expected output:
700000000.000000000000
539999999.999999880791
Problem p02208 test case
Input:
1 1 1 1 1 1 1
1 1
1 1

Expected output:
1
Problem p02209 test case
Input:
5 9
8 6 9 1 2

Expected output:
2
Problem p02210 test case
Input:
5 0
1 1 1 1 1

Expected output:
1
Problem p02211 test case
Input:
5 5 2
s..#a
.#...
a#e.#
...#a
.#...

Expected output:
14
Problem p02212 test case
Input:
2 1 3 4

Expected output:
0
Problem p02213 test case
Input:
3 3
631
4#2
516

Expected output:
YES
Problem p02214 test case
Input:
4 4
1 2 1
1 3 8
3 2 0
1 4 7
4
1 2 1
2 1 2
1 4 1
3 4 1073741824

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

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

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

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

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

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

Expected output:
1
1 0100101
Problem p02221 test case
Input:
2
100
1 4 2 3

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

Expected output:
1100111
Problem p02223 test case
Input:
2

Expected output:
2
0
11
Problem p02233 test case
Input:
3

Expected output:
3
Problem p02234 test case
Input:
6
30 35
35 15
15 5
5 10
10 20
20 25

Expected output:
15125
Problem p02235 test case
Input:
3
abcbdab
bdcaba
abc
abc
abc
bc

Expected output:
4
3
2
Problem p02236 test case
Input:
5
0.1500 0.1000 0.0500 0.1000 0.2000
0.0500 0.1000 0.0500 0.0500 0.0500 0.1000

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

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

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

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

Expected output:
yes
yes
no
Problem p02241 test case
Input:
5
 -1 2 3 1 -1
 2 -1 -1 4 -1
 3 -1 -1 1 1
 1 4 1 -1 3
 -1 -1 1 3 -1

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

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

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

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

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

Expected output:
8
Problem p02247 test case
Input:
aabaaa
aa

Expected output:
0
3
4
Problem p02248 test case
Input:
aabaaa
aa

Expected output:
0
3
4
Problem p02249 test case
Input:
4 5
00010
00101
00010
00100
3 2
10
01
10

Expected output:
0 3
1 2
Problem p02250 test case
Input:
aabaaa
4
aa
ba
bb
xyz

Expected output:
1
1
0
0
Problem p02251 test case
Input:
100

Expected output:
4
Problem p02252 test case
Input:
3 50
60 10
100 20
120 30

Expected output:
240
Problem p02253 test case
Input:
5
1 2
3 9
3 5
5 9
6 8

Expected output:
3
Problem p02254 test case
Input:
abca

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

Expected output:
5 2 4 6 1 3
2 5 4 6 1 3
2 4 5 6 1 3
2 4 5 6 1 3
1 2 4 5 6 3
1 2 3 4 5 6
Problem p02256 test case
Input:
54 20

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

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

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

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

Expected output:
1 2 3 4 5 6
4
Problem p02261 test case
Input:
5
H4 C9 S4 D2 C3

Expected output:
D2 C3 H4 S4 C9
Stable
D2 C3 S4 H4 C9
Not stable
Problem p02262 test case
Input:
5
5
1
4
3
2

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

Expected output:
3
Problem p02264 test case
Input:
5 100
p1 150
p2 80
p3 200
p4 350
p5 20

Expected output:
p2 180
p5 400
p1 450
p3 550
p4 800
Problem p02265 test case
Input:
7
insert 5
insert 2
insert 3
insert 1
delete 3
insert 6
delete 5

Expected output:
6 1 2
Problem p02266 test case
Input:
\\//

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

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

Expected output:
3
Problem p02269 test case
Input:
5
insert A
insert T
insert C
find G
find A

Expected output:
no
yes
Problem p02270 test case
Input:
5 3
8
1
7
3
9

Expected output:
10
Problem p02271 test case
Input:
5
1 5 7 10 21
8
2 4 17 8 22 21 100 35

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

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

Expected output:
0.00000000 0.00000000
33.33333333 0.00000000
50.00000000 28.86751346
66.66666667 0.00000000
100.00000000 0.00000000
Problem p02274 test case
Input:
5
3 5 2 1 4

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

Expected output:
0 1 2 2 3 3 5
Problem p02276 test case
Input:
12
13 19 9 5 12 8 7 4 21 2 6 11

Expected output:
9 5 8 7 4 2 6 [11] 21 13 19 12
Problem p02277 test case
Input:
6
D 3
H 2
D 1
S 3
D 2
C 1

Expected output:
Not stable
D 1
C 1
D 2
H 2
D 3
S 3
Problem p02278 test case
Input:
5
1 5 3 4 2

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

Expected output:
node 0: parent = -1, depth = 0, root, [1, 4, 10]
node 1: parent = 0, depth = 1, internal node, [2, 3]
node 2: parent = 1, depth = 2, leaf, []
node 3: parent = 1, depth = 2, leaf, []
node 4: parent = 0, depth = 1, internal node, [5, 6, 7]
node 5: parent = 4, depth = 2, leaf, []
node 6: parent = 4, depth = 2, leaf, []
node 7: parent = 4, depth = 2, internal node, [8, 9]
node 8: parent = 7, depth = 3, leaf, []
node 9: parent = 7, depth = 3, leaf, []
node 10: parent = 0, depth = 1, internal node, [11, 12]
node 11: parent = 10, depth = 2, leaf, []
node 12: parent = 10, depth = 2, leaf, []
Problem p02280 test case
Input:
9
0 1 4
1 2 3
2 -1 -1
3 -1 -1
4 5 8
5 6 7
6 -1 -1
7 -1 -1
8 -1 -1

Expected output:
node 0: parent = -1, sibling = -1, degree = 2, depth = 0, height = 3, root
node 1: parent = 0, sibling = 4, degree = 2, depth = 1, height = 1, internal node
node 2: parent = 1, sibling = 3, degree = 0, depth = 2, height = 0, leaf
node 3: parent = 1, sibling = 2, degree = 0, depth = 2, height = 0, leaf
node 4: parent = 0, sibling = 1, degree = 2, depth = 1, height = 2, internal node
node 5: parent = 4, sibling = 8, degree = 2, depth = 2, height = 1, internal node
node 6: parent = 5, sibling = 7, degree = 0, depth = 3, height = 0, leaf
node 7: parent = 5, sibling = 6, degree = 0, depth = 3, height = 0, leaf
node 8: parent = 4, sibling = 5, degree = 0, depth = 2, height = 0, leaf
Problem p02281 test case
Input:
9
0 1 4
1 2 3
2 -1 -1
3 -1 -1
4 5 8
5 6 7
6 -1 -1
7 -1 -1
8 -1 -1

Expected output:
Preorder
 0 1 2 3 4 5 6 7 8
Inorder
 2 1 3 0 6 5 7 4 8
Postorder
 2 3 1 6 7 5 8 4 0
Problem p02282 test case
Input:
5
1 2 3 4 5
3 2 4 1 5

Expected output:
3 4 2 5 1
Problem p02283 test case
Input:
8
insert 30
insert 88
insert 12
insert 1
insert 20
insert 17
insert 25
print

Expected output:
 1 12 17 20 25 30 88
 30 12 1 20 17 25 88
Problem p02284 test case
Input:
10
insert 30
insert 88
insert 12
insert 1
insert 20
find 12
insert 17
insert 25
find 16
print

Expected output:
yes
no
 1 12 17 20 25 30 88
 30 12 1 20 17 25 88
Problem p02285 test case
Input:
18
insert 8
insert 2
insert 3
insert 7
insert 22
insert 1
find 1
find 2
find 3
find 4
find 5
find 6
find 7
find 8
print
delete 3
delete 7
print

Expected output:
yes
yes
yes
no
no
no
yes
yes
 1 2 3 7 8 22
 8 2 1 3 7 22
 1 2 8 22
 8 2 1 22
Problem p02286 test case
Input:
16
insert 35 99
insert 3 80
insert 1 53
insert 14 25
insert 80 76
insert 42 3
insert 86 47
insert 21 12
insert 7 10
insert 6 90
print
find 21
find 22
delete 35
delete 99
print

Expected output:
 1 3 6 7 14 21 35 42 80 86
 35 6 3 1 14 7 21 80 42 86
yes
no
 1 3 6 7 14 21 42 80 86
 6 3 1 80 14 7 21 42 86
Problem p02287 test case
Input:
5
7 8 1 2 3

Expected output:
node 1: key = 7, left key = 8, right key = 1,
node 2: key = 8, parent key = 7, left key = 2, right key = 3,
node 3: key = 1, parent key = 7,
node 4: key = 2, parent key = 8,
node 5: key = 3, parent key = 8,
Problem p02288 test case
Input:
10
4 1 3 2 16 9 10 14 8 7

Expected output:
 16 14 10 8 7 9 3 2 4 1
Problem p02289 test case
Input:
insert 8
insert 2
extract
insert 10
extract
insert 11
extract
extract
end

Expected output:
8
10
11
2
Problem p02290 test case
Input:
0 0 2 0
3
-1 1
0 1
1 1

Expected output:
-1.0000000000 0.0000000000
0.0000000000 0.0000000000
1.0000000000 0.0000000000
Problem p02291 test case
Input:
0 0 2 0
3
-1 1
0 1
1 1

Expected output:
-1.0000000000 -1.0000000000
0.0000000000 -1.0000000000
1.0000000000 -1.0000000000
Problem p02292 test case
Input:
0 0 2 0
2
-1 1
-1 -1

Expected output:
COUNTER_CLOCKWISE
CLOCKWISE
Problem p02293 test case
Input:
3
0 0 3 0 0 2 3 2
0 0 3 0 1 1 1 4
0 0 3 0 1 1 2 2

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

Expected output:
1
1
0
Problem p02295 test case
Input:
3
0 0 2 0 1 1 1 -1
0 0 1 1 0 1 1 0
0 0 1 1 1 0 0 1

Expected output:
1.0000000000 0.0000000000
0.5000000000 0.5000000000
0.5000000000 0.5000000000
Problem p02296 test case
Input:
3
0 0 1 0 0 1 1 1
0 0 1 0 2 1 1 2
-1 0 1 0 0 1 0 -1

Expected output:
1.0000000000
1.4142135624
0.0000000000
Problem p02297 test case
Input:
3
0 0
2 2
-1 1

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

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

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

Expected output:
5
0 0
2 1
4 2
3 3
1 3
Problem p02301 test case
Input:
3
0.0 0.0
4.0 0.0
2.0 2.0

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

Expected output:
2.00000000
4.00000000
Problem p02303 test case
Input:
2
0.0 0.0
1.0 0.0

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

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

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

Expected output:
0.53907943898209422325 -0.26437392711448356856 1.18845545916395465278
Problem p02307 test case
Input:
1 -2
3 2
-2 0

Expected output:
0.62500000000000000000 0.68750000000000000000 2.71353666826155124291
Problem p02308 test case
Input:
2 1 1
2
0 1 4 1
3 0 3 3

Expected output:
1.00000000 1.00000000 3.00000000 1.00000000
3.00000000 1.00000000 3.00000000 1.00000000
Problem p02309 test case
Input:
0 0 2
2 0 2

Expected output:
1.00000000 -1.73205080 1.00000000 1.73205080
Problem p02310 test case
Input:
0 0
2 2 2

Expected output:
0.0000000000 2.0000000000
2.0000000000 0.0000000000
Problem p02311 test case
Input:
1 1 1
6 2 2

Expected output:
0.6153846154 1.9230769231
1.0000000000 0.0000000000
1.4183420913 1.9082895434
1.7355040625 0.3224796874
Problem p02312 test case
Input:
3 5
1 1
4 1
5 5

Expected output:
4.639858417607
Problem p02313 test case
Input:
0 0 1
2 0 2

Expected output:
1.40306643968573875104
Problem p02314 test case
Input:
55 4
1 5 10 50

Expected output:
2