Codeforces Round 425 (Div. 2)


A. Sasha and Sticks
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 1
Output
YES
Input
10 4
Output
NO
----------------------------------------------------------------------------------------------------
B. Petya and Exam
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
ab
a?a
2
aaa
aab
Output
YES
NO
Input
abc
a?a?a*
4
abacaba
abaca
apapa
aaaaax
Output
NO
YES
NO
YES
----------------------------------------------------------------------------------------------------
C. Strange Radiation
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 999
400000 1 2
500000 1 1
Output
500000.000000000000000000000000000000
Input
2 1000
400000 500 1
600000 500 2
Output
400.000000000000000000000000000000
----------------------------------------------------------------------------------------------------
D. Misha, Grisha and Underground
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 2
1 1
1 2 3
2 3 3
Output
2
3
Input
4 1
1 2 3
1 2 3
Output
2
----------------------------------------------------------------------------------------------------
E. Vasya and Shifts
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 1
b
2
a
e
Output
1
1
Input
2 4
aaaa
bbbb
1
cccc
Output
5
----------------------------------------------------------------------------------------------------
