MemSQL start[c]up Round 2


A. Banana
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
banana
4
Output
2
baan
Input
banana
3
Output
3
nab
Input
banana
2
Output
-1
----------------------------------------------------------------------------------------------------
B. Palindrome
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
bbbabcbbb
Output
bbbcbbb
Input
rquwmzexectvnbanemsmdufrg
Output
rumenanemur
----------------------------------------------------------------------------------------------------
C. More Reclamation
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 1
1 1
Output
WIN
Input
12 2
4 1
8 1
Output
WIN
Input
1 1
1 2
Output
LOSE
----------------------------------------------------------------------------------------------------
D. Rectangles and Square
time limit per test: 3 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
9
0 0 1 9
1 0 9 1
1 8 9 9
8 1 9 8
2 2 3 6
3 2 7 3
2 6 7 7
5 3 7 6
3 3 5 6
Output
YES 5
5 6 7 8 9
Input
4
0 0 1 9
1 0 9 1
1 8 9 9
8 1 9 8
Output
NO
----------------------------------------------------------------------------------------------------
E. Counting Skyscrapers
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
Alice
3 1
Output
3.500000000
Input
Bob
2 30
Output
2
Input
Alice
2572 10
Output
3439.031415943
----------------------------------------------------------------------------------------------------
F. Buy One, Get One Free
time limit per test: 5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
3 4 5 3 4 5
Output
14
Input
5
5 5 5 5 5
Output
25
Input
4
309999 6000 2080 2080
Output
314159
----------------------------------------------------------------------------------------------------
