AIM Tech Round (Div. 1)


A. 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
----------------------------------------------------------------------------------------------------
B. 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
----------------------------------------------------------------------------------------------------
C. 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
----------------------------------------------------------------------------------------------------
D. Birthday
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
50 50
Output
5.0000000000
Input
4
50 20 20 10
Output
39.2846263444
----------------------------------------------------------------------------------------------------
E. Transforming Sequence
time limit per test: 7 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 2
Output
3
Input
2 3
Output
30
Input
3 3
Output
48
----------------------------------------------------------------------------------------------------
