mBIT Advanced Spring 2021
A. Pokémon Permutation
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
atatatraartttaarttata
Output
rattatarattatarattata

B. Azran Tablets
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
azrantablets
Output
4

C. Goomba Grouping
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
2
8 1
1 10
Output
9 13 16 15 19 20 15 18
-1

D. Cytus Craze
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
3 2
Output
6

E. Knockout Tournament
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
2
2 3 5 1
Output
666666678

F. Squid Art
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
6 10
0100000001
0011010100
1001101101
1010011010
0011101101
0101001011
Output
2

G. Scribble Roads
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
2
2 0
5 3
1 2
1 3
2 3
Output
WIN
LOSE

H. Future Gadget Lab
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
4 2 100000
1 2
2 3
1 4
Output
0.800000000000000

I. Immortality Potion
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
0 4 2
Output
5
F 1 c
F 2 b
P 1 3
P 2 3
! 3

J. Luigi's Mansion
time limit per test
1 second
memory limit per test
512 megabytes
input
standard input
output
standard output
Example
Input
3 18
1 2 3
Output
25/3

K. Kirby's Buffet
time limit per test
3 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
5 5
7 11 9 13 5
2 5 12
1 5 1
1 3 3
2 4 11
1 5 4
Output
NO
YES
YES
YES
NO

L. Pillar Path
time limit per test
5 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output
Example
Input
3
3 15 17 1
5 11 3 5
11 10 2 4
13 4 4 1
Output
21.351991750