Codeforces Round 232 (Div. 1)


A. On Number of Decompositions into Multipliers
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
15
Output
1
Input
3
1 1 2
Output
3
Input
2
5 7
Output
4
----------------------------------------------------------------------------------------------------
B. On Sum of Fractions
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
2
3
Output
1/6
7/30
----------------------------------------------------------------------------------------------------
C. On Changing Tree
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 1
3
1 1 2 1
2 1
2 2
Output
2
1
----------------------------------------------------------------------------------------------------
D. On Sum of Number of Inversions in Permutations
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
2 1
Output
1
Input
3
2 1 3
Output
2
----------------------------------------------------------------------------------------------------
E. On Iteration of One Well-Known Function
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
7 1
1
Output
2
2 1
3 1
Input
1
7 1
2
Output
1
2 1
Input
1
2 100000000000000000
10000000000000000
Output
1
2 90000000000000000
----------------------------------------------------------------------------------------------------
