AIM Tech Round (Div. 2)


A. Save Luke
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 6 2 2
Output
1.00000000000000000000
Input
1 9 1 2
Output
2.66666666666666650000
----------------------------------------------------------------------------------------------------
B. Making a String
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
2 5 5
Output
11
Input
3
1 1 2
Output
3
----------------------------------------------------------------------------------------------------
C. Graph and String
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 1
1 2
Output
Yes
aa
Input
4 3
1 2
1 3
1 4
Output
No
----------------------------------------------------------------------------------------------------
D. Array GCD
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 1 4
4 2 3
Output
1
Input
5 3 2
5 17 13 5 6
Output
8
Input
8 3 4
3 7 5 4 3 12 9 4
Output
13
----------------------------------------------------------------------------------------------------
E. Electric Charges
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 10
1 20
1 30
Output
0
Input
2
1 10
10 1
Output
2
----------------------------------------------------------------------------------------------------
