alexjercan/bugnet huggingface dataset:
Problem p02623 test case
Input:
3 4 240
60 90 120
80 150 80 150

Expected output:
3
Problem p02624 test case
Input:
4

Expected output:
23
Problem p02625 test case
Input:
2 2

Expected output:
2
Problem p02626 test case
Input:
2
5 3

Expected output:
1
Problem p02627 test case
Input:
B

Expected output:
A
Problem p02628 test case
Input:
5 3
50 100 80 120 80

Expected output:
210
Problem p02629 test case
Input:
2

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

Expected output:
11
12
16
Problem p02631 test case
Input:
4
20 11 9 24

Expected output:
26 5 7 22
Problem p02632 test case
Input:
5
oof

Expected output:
575111451
Problem p02633 test case
Input:
90

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

Expected output:
3
Problem p02635 test case
Input:
0101 1

Expected output:
4
Problem p02636 test case
Input:
0001

Expected output:
8
Problem p02637 test case
Input:
3
2 4 3

Expected output:
2 1 3 2 2 3 1 2 3
Problem p02638 test case
Input:
4 3 998244353

Expected output:
56
Problem p02639 test case
Input:
0 2 3 4 5

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

Expected output:
Yes
Problem p02641 test case
Input:
6 5
4 7 10 6 5

Expected output:
8
Problem p02642 test case
Input:
5
24 11 8 3 16

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

Expected output:
6
2
6
Problem p02644 test case
Input:
3 5 2
3 2 3 4
.....
.@..@
..@..

Expected output:
5
Problem p02645 test case
Input:
takahashi

Expected output:
tak
Problem p02646 test case
Input:
1 2
3 1
3

Expected output:
YES
Problem p02647 test case
Input:
5 1
1 0 0 1 0

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

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

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

Expected output:
12
Problem p02651 test case
Input:
3
2
1 2
10
2
1 1
10
6
2 3 4 5 6 7
111000

Expected output:
1
0
0
Problem p02652 test case
Input:
0??

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

Expected output:
11
Problem p02654 test case
Input:
3 1

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

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

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

Expected output:
10
Problem p02658 test case
Input:
2
1000000000 1000000000

Expected output:
1000000000000000000
Problem p02659 test case
Input:
198 1.10

Expected output:
217
Problem p02660 test case
Input:
24

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

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

Expected output:
6
Problem p02663 test case
Input:
10 0 15 0 30

Expected output:
270
Problem p02664 test case
Input:
PD?D??P

Expected output:
PDPDPDP
Problem p02665 test case
Input:
3
0 1 1 2

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

Expected output:
8
Problem p02667 test case
Input:
1101

Expected output:
5
Problem p02668 test case
Input:
2 5

Expected output:
352
Problem p02669 test case
Input:
5
11 1 2 4 8
11 1 2 2 8
32 10 8 5 4
29384293847243 454353412 332423423 934923490 1
900000000000000000 332423423 454353412 934923490 987654321

Expected output:
20
19
26
3821859835
23441258666
Problem p02670 test case
Input:
3
1 3 7 9 5 4 8 6 2

Expected output:
1
Problem p02671 test case
Input:
1
SRS

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

Expected output:
4.700000000000
Problem p02674 test case
Input:
2

Expected output:
1
Problem p02675 test case
Input:
16

Expected output:
pon
Problem p02676 test case
Input:
7
nikoandsolstice

Expected output:
nikoand...
Problem p02677 test case
Input:
3 4 9 0

Expected output:
5.00000000000000000000
Problem p02678 test case
Input:
4 4
1 2
2 3
3 4
4 2

Expected output:
Yes
1
2
2
Problem p02679 test case
Input:
3
1 2
-1 1
2 -1

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

Expected output:
13
Problem p02681 test case
Input:
chokudai
chokudaiz

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

Expected output:
2
Problem p02683 test case
Input:
3 3 10
60 2 2 4
70 8 7 9
50 2 3 9

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

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

Expected output:
6
Problem p02686 test case
Input:
2
)
(()

Expected output:
Yes
Problem p02687 test case
Input:
ABC

Expected output:
ARC
Problem p02688 test case
Input:
3 2
2
1 3
1
3

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

Expected output:
2
Problem p02690 test case
Input:
33

Expected output:
2 -1
Problem p02691 test case
Input:
6
2 3 3 1 3 1

Expected output:
3
Problem p02692 test case
Input:
2 1 3 0
AB
AC

Expected output:
Yes
A
C
Problem p02693 test case
Input:
7
500 600

Expected output:
OK
Problem p02694 test case
Input:
103

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

Expected output:
110
Problem p02696 test case
Input:
5 7 4

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

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

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

Expected output:
unsafe
Problem p02700 test case
Input:
10 9 10 10

Expected output:
No
Problem p02701 test case
Input:
3
apple
orange
apple

Expected output:
2
Problem p02702 test case
Input:
1817181712114

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

Expected output:
2
14
Problem p02704 test case
Input:
2
0 1
1 0
1 1
1 0

Expected output:
1 1
1 0
Problem p02705 test case
Input:
1

Expected output:
6.28318530717958623200
Problem p02706 test case
Input:
41 2
5 6

Expected output:
30
Problem p02707 test case
Input:
5
1 1 2 2

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

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

Expected output:
20
Problem p02710 test case
Input:
3
1 2 1
1 2
2 3

Expected output:
5
4
0
Problem p02711 test case
Input:
117

Expected output:
Yes
Problem p02712 test case
Input:
15

Expected output:
60
Problem p02713 test case
Input:
2

Expected output:
9
Problem p02714 test case
Input:
4
RRGB

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

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

Expected output:
12
Problem p02717 test case
Input:
1 2 3

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

Expected output:
Yes
Problem p02719 test case
Input:
7 4

Expected output:
1
Problem p02720 test case
Input:
15

Expected output:
23
Problem p02721 test case
Input:
11 3 2
ooxxxoxxxoo

Expected output:
6
Problem p02722 test case
Input:
6

Expected output:
3
Problem p02723 test case
Input:
sippuu

Expected output:
Yes
Problem p02724 test case
Input:
1024

Expected output:
2020
Problem p02725 test case
Input:
20 3
5 10 15

Expected output:
10
Problem p02726 test case
Input:
5 2 4

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

Expected output:
12
Problem p02728 test case
Input:
3
1 2
1 3

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

Expected output:
1
Problem p02730 test case
Input:
akasaka

Expected output:
Yes
Problem p02731 test case
Input:
3

Expected output:
1.000000000000
Problem p02732 test case
Input:
5
1 1 2 1 2

Expected output:
2
2
3
2
3
Problem p02733 test case
Input:
3 5 4
11100
10001
00111

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

Expected output:
5
Problem p02735 test case
Input:
3 3
.##
.#.
##.

Expected output:
1
Problem p02736 test case
Input:
4
1231

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

Expected output:
46494701
Problem p02738 test case
Input:
1 998244353

Expected output:
6
Problem p02739 test case
Input:
1
10

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

Expected output:
3
42
-1
Problem p02741 test case
Input:
6

Expected output:
2
Problem p02742 test case
Input:
4 5

Expected output:
10
Problem p02743 test case
Input:
2 3 9

Expected output:
No
Problem p02744 test case
Input:
1

Expected output:
a
Problem p02745 test case
Input:
a?c
der
cod

Expected output:
7
Problem p02746 test case
Input:
2
4 2 7 4
9 9 1 9

Expected output:
5
8
Problem p02747 test case
Input:
hihi

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

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

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

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

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

Expected output:
3
Problem p02753 test case
Input:
ABA

Expected output:
Yes
Problem p02754 test case
Input:
8 3 4

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

Expected output:
25
Problem p02756 test case
Input:
a
4
2 1 p
1
2 2 c
1

Expected output:
cpa
Problem p02757 test case
Input:
4 3
3543

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

Expected output:
3
Problem p02759 test case
Input:
5

Expected output:
3
Problem p02760 test case
Input:
84 97 66
79 89 11
61 59 7
7
89
7
87
79
24
84
30

Expected output:
Yes
Problem p02761 test case
Input:
3 3
1 7
3 2
1 7

Expected output:
702
Problem p02762 test case
Input:
4 4 1
2 1
1 3
3 2
3 4
4 1

Expected output:
0 1 0 1
Problem p02763 test case
Input:
7
abcdbbd
6
2 3 6
1 5 z
2 1 1
1 4 a
1 7 d
2 1 7

Expected output:
3
1
5
Problem p02764 test case
Input:
4 3
-1 0 3
0 0 3
1 0 2
1 1 40

Expected output:
2.4
Problem p02765 test case
Input:
2 2919

Expected output:
3719
Problem p02766 test case
Input:
11 2

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

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

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

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

Expected output:
1
Problem p02771 test case
Input:
5 7 5

Expected output:
Yes
Problem p02772 test case
Input:
5
6 7 9 10 31

Expected output:
APPROVED
Problem p02773 test case
Input:
7
beat
vet
beet
bed
vet
bet
beet

Expected output:
beet
vet
Problem p02774 test case
Input:
4 3
3 3 -4 -2

Expected output:
-6
Problem p02775 test case
Input:
36

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

Expected output:
2
1 4
Problem p02777 test case
Input:
red blue
3 4
red

Expected output:
2 4
Problem p02778 test case
Input:
sardine

Expected output:
xxxxxxx
Problem p02779 test case
Input:
5
2 6 1 4 5

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

Expected output:
7.000000000000
Problem p02781 test case
Input:
100
1

Expected output:
19
Problem p02782 test case
Input:
1 1 2 2

Expected output:
14
Problem p02783 test case
Input:
10 4

Expected output:
3
Problem p02784 test case
Input:
10 3
4 5 6

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

Expected output:
5
Problem p02786 test case
Input:
2

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

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

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

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

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

Expected output:
3
Problem p02792 test case
Input:
25

Expected output:
17
Problem p02793 test case
Input:
3
2 3 4

Expected output:
13
Problem p02794 test case
Input:
3
1 2
2 3
1
1 3

Expected output:
3
Problem p02795 test case
Input:
3
7
10

Expected output:
2
Problem p02796 test case
Input:
4
2 4
4 3
9 3
100 5

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

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

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

Expected output:
BWWBB
4
3
1
5
2
Problem p02800 test case
Input:
2 2
#.
.#

Expected output:
15
Problem p02801 test case
Input:
a

Expected output:
b
Problem p02802 test case
Input:
2 5
1 WA
1 AC
2 WA
2 AC
2 WA

Expected output:
2 2
Problem p02803 test case
Input:
3 3
...
...
...

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

Expected output:
11
Problem p02805 test case
Input:
2
0 0
1 0

Expected output:
0.500000000000000000
Problem p02806 test case
Input:
3
dwango 2
sixth 5
prelims 25
dwango

Expected output:
30
Problem p02807 test case
Input:
3
1 2 3

Expected output:
5
Problem p02808 test case
Input:
3 2
3 2

Expected output:
12
Problem p02809 test case
Input:
4
2 3 4 1

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

Expected output:
10
Problem p02811 test case
Input:
2 900

Expected output:
Yes
Problem p02812 test case
Input:
10
ZABCDBABCQ

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

Expected output:
3
Problem p02814 test case
Input:
2 50
6 10

Expected output:
2
Problem p02815 test case
Input:
1
1000000000

Expected output:
999999993
Problem p02816 test case
Input:
3
0 2 1
1 2 3

Expected output:
1 3
Problem p02817 test case
Input:
oder atc

Expected output:
atcoder
Problem p02818 test case
Input:
2 3 3

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

Expected output:
23
Problem p02820 test case
Input:
5 2
8 7 6
rsrpr

Expected output:
27
Problem p02821 test case
Input:
5 3
10 14 19 34 33

Expected output:
202
Problem p02822 test case
Input:
3
1 2
2 3

Expected output:
125000001
Problem p02823 test case
Input:
5 2 4

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

Expected output:
5
Problem p02825 test case
Input:
6

Expected output:
aabb..
b..zz.
ba....
.a..aa
..a..b
..a..b
Problem p02826 test case
Input:
2 998244353

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

Expected output:
^^^^^
Problem p02828 test case
Input:
2
2 2

Expected output:
11
Problem p02829 test case
Input:
3
1

Expected output:
2
Problem p02830 test case
Input:
2
ip cc

Expected output:
icpc
Problem p02831 test case
Input:
2 3

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

Expected output:
1
Problem p02833 test case
Input:
12

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

Expected output:
2
Problem p02835 test case
Input:
5 7 9

Expected output:
win
Problem p02836 test case
Input:
redcoder

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

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

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

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

Expected output:
8
Problem p02841 test case
Input:
11 16
11 17

Expected output:
0
Problem p02842 test case
Input:
432

Expected output:
400
Problem p02843 test case
Input:
615

Expected output:
1
Problem p02844 test case
Input:
4
0224

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

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

Expected output:
1
Problem p02847 test case
Input:
SAT

Expected output:
1
Problem p02848 test case
Input:
2
ABCXYZ

Expected output:
CDEZAB
Problem p02849 test case
Input:
10 7 100

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

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

Expected output:
4
Problem p02852 test case
Input:
9 3
0001000100

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

Expected output:
1000000
Problem p02854 test case
Input:
3
2 4 3

Expected output:
3
Problem p02855 test case
Input:
3 3 5
#.#
.#.
#.#

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

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

Expected output:
9
Problem p02859 test case
Input:
2

Expected output:
4
Problem p02860 test case
Input:
6
abcabc

Expected output:
Yes
Problem p02861 test case
Input:
3
0 0
1 0
0 1

Expected output:
2.2761423749
Problem p02862 test case
Input:
3 3

Expected output:
2
Problem p02863 test case
Input:
2 60
10 10
100 100

Expected output:
110
Problem p02864 test case
Input:
4 1
2 3 4 1

Expected output:
3
Problem p02865 test case
Input:
4

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

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

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

Expected output:
5
Problem p02869 test case
Input:
1 1

Expected output:
1 2 3
Problem p02870 test case
Input:
4
o?o
???
?x?

Expected output:
1
Problem p02873 test case
Input:
<>>

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

Expected output:
6
Problem p02875 test case
Input:
2

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

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

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

Expected output:
4
Problem p02879 test case
Input:
2 5

Expected output:
10
Problem p02880 test case
Input:
10

Expected output:
Yes
Problem p02881 test case
Input:
10

Expected output:
5
Problem p02882 test case
Input:
2 2 4

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

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

Expected output:
1.5000000000
Problem p02885 test case
Input:
12 4

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

Expected output:
11
Problem p02887 test case
Input:
10
aabbbbaaca

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

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

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

Expected output:
3
1
0
Problem p02891 test case
Input:
issii
2

Expected output:
4
Problem p02892 test case
Input:
2
01
10

Expected output:
2
Problem p02893 test case
Input:
3
111

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

Expected output:
0.414213562373095 -0.000000000000000
Problem p02895 test case
Input:
3
011111
101111
110111
111011
111101
111110

Expected output:
3
Problem p02896 test case
Input:
2 2 2 998244353

Expected output:
35
Problem p02897 test case
Input:
4

Expected output:
0.5000000000
Problem p02898 test case
Input:
4 150
150 140 100 200

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

Expected output:
3 1 2
Problem p02900 test case
Input:
12 18

Expected output:
3
Problem p02901 test case
Input:
2 3
10 1
1
15 1
2
30 2
1 2

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

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

Expected output:
100
010
001
Problem p02904 test case
Input:
5 3
0 2 1 4 3

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

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

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

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

Expected output:
3
Problem p02909 test case
Input:
Sunny

Expected output:
Cloudy
Problem p02910 test case
Input:
RUDLUDR

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

Expected output:
No
No
Yes
No
No
No
Problem p02912 test case
Input:
3 3
2 13 8

Expected output:
9
Problem p02913 test case
Input:
5
ababa

Expected output:
2
Problem p02914 test case
Input:
3
3 6 5

Expected output:
12
Problem p02915 test case
Input:
2

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

Expected output:
14
Problem p02917 test case
Input:
3
2 5

Expected output:
9
Problem p02918 test case
Input:
6 1
LRLRRL

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

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

Expected output:
Yes
Problem p02921 test case
Input:
CSS
CSR

Expected output:
2
Problem p02922 test case
Input:
4 10

Expected output:
3
Problem p02923 test case
Input:
5
10 4 8 7 3

Expected output:
2
Problem p02924 test case
Input:
2

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

Expected output:
3
Problem p02926 test case
Input:
3
0 10
5 -5
-5 -5

Expected output:
10.000000000000000000000000000000000000000000000000
Problem p02927 test case
Input:
15 40

Expected output:
10
Problem p02928 test case
Input:
2 2
2 1

Expected output:
3
Problem p02929 test case
Input:
2
BWWB

Expected output:
4
Problem p02930 test case
Input:
3

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

Expected output:
28
Problem p02932 test case
Input:
4 2 3 7

Expected output:
105
Problem p02933 test case
Input:
3200
pink

Expected output:
pink
Problem p02934 test case
Input:
2
10 30

Expected output:
7.5
Problem p02935 test case
Input:
2
3 4

Expected output:
3.5
Problem p02936 test case
Input:
4 3
1 2
2 3
2 4
2 10
1 100
3 1

Expected output:
100 110 111 110
Problem p02937 test case
Input:
contest
son

Expected output:
10
Problem p02938 test case
Input:
2 3

Expected output:
3
Problem p02939 test case
Input:
aabbaa

Expected output:
4
Problem p02940 test case
Input:
3
RRRGGGBBB

Expected output:
216
Problem p02941 test case
Input:
3
1 1 1
13 5 7

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

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

Expected output:
aabca
Problem p02944 test case
Input:
9 3
2 1 1 1 1 1 1 2 3

Expected output:
22
Problem p02945 test case
Input:
-13 3

Expected output:
-10
Problem p02946 test case
Input:
3 7

Expected output:
5 6 7 8 9
Problem p02947 test case
Input:
3
acornistnt
peanutbomb
constraint

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

Expected output:
5
Problem p02949 test case
Input:
3 3 10
1 2 20
2 3 30
1 3 45

Expected output:
35
Problem p02950 test case
Input:
2
1 0

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

Expected output:
1
Problem p02952 test case
Input:
11

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

Expected output:
Yes
Problem p02954 test case
Input:
RRLRL

Expected output:
0 1 2 1 1
Problem p02955 test case
Input:
2 3
8 20

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

Expected output:
13
Problem p02957 test case
Input:
2 16

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

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

Expected output:
9
Problem p02960 test case
Input:
??2??5

Expected output:
768
Problem p02962 test case
Input:
abcabab
ab

Expected output:
3
Problem p02963 test case
Input:
3

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

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

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

Expected output:
2
Problem p02967 test case
Input:
ABBCBCAB

Expected output:
ACBCAB
Problem p02968 test case
Input:
2 998244353

Expected output:
4
Problem p02969 test case
Input:
4

Expected output:
48
Problem p02970 test case
Input:
6 2

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

Expected output:
4
3
4
Problem p02972 test case
Input:
3
1 0 0

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

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

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

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

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

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

Expected output:
16
Problem p02979 test case
Input:
3 1 998244353

Expected output:
7
Problem p02980 test case
Input:
1 2

Expected output:
8
Problem p02981 test case
Input:
4 2 9

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

Expected output:
1
Problem p02983 test case
Input:
2020 2040

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

Expected output:
4 0 4
Problem p02986 test case
Input:
5 3
1 2 1 10
1 3 2 20
2 4 4 30
5 2 1 40
1 100 1 4
1 100 1 5
3 1000 3 4

Expected output:
130
200
60
Problem p02987 test case
Input:
ASSA

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

Expected output:
2
Problem p02989 test case
Input:
6
9 1 4 4 6 7

Expected output:
2
Problem p02990 test case
Input:
5 3

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

Expected output:
2