Codeforces Round 641 (Div. 1)


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

Examples
Input
2
1 1
Output
1
Input
2
1 2
Output
3
Input
5
0 0 0 0 35
Output
0
Input
5
8 4 2 0 1
Output
801604029
----------------------------------------------------------------------------------------------------
E. Slime and Hats
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
0 1 1 0 0
Output
00000
Input
5
0 2 2 0 0
Output
00001
Input
5
0 0 0 0 0
Output
00000
Input
5
4 4 0 4 4
Output
00100
----------------------------------------------------------------------------------------------------
F1. 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 
----------------------------------------------------------------------------------------------------
F2. Slime and Sequences (Hard Version)
time limit per test: 3 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 
----------------------------------------------------------------------------------------------------
