Codeforces Round 641 (Div. 2)


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

Examples
Input
3
5 1
8 2
3 4
Output
10
12
12
----------------------------------------------------------------------------------------------------
B. Orac and Models
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
4
5 3 4 6
7
1 4 2 3 6 4 9
5
5 4 3 2 1
1
9
Output
2
3
1
1
----------------------------------------------------------------------------------------------------
C. Orac and LCM
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
1 1
Output
1
Input
4
10 24 40 80
Output
40
Input
10
540 648 810 648 720 540 594 864 972 648
Output
54
----------------------------------------------------------------------------------------------------
D. Orac and Medians
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
5 3
1 5 2 6 1
1 6
6
3 2
1 2 3
4 3
3 1 2 3
10 3
1 2 3 4 5 6 7 8 9 10
Output
no
yes
yes
no
yes
----------------------------------------------------------------------------------------------------
E. Orac and Game of Life
time limit per test: 2 seconds
memory limit per test: 128 megabytes
input: standard input
output: standard output

Examples
Input
3 3 3
000
111
000
1 1 1
2 2 2
3 3 3
Output
1
1
1
Input
5 2 2
01
10
01
10
01
1 1 4
5 1 4
Output
0
0
Input
5 5 3
01011
10110
01101
11010
10101
1 1 4
1 2 3
5 5 3
Output
1
0
1
Input
1 1 3
0
1 1 1
1 1 2
1 1 3
Output
0
0
0
----------------------------------------------------------------------------------------------------
F. Slime and Sequences (Easy Version)
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
Output
3 1 
Input
3
Output
10 7 1 
Input
1
Output
1 
----------------------------------------------------------------------------------------------------
