Educational Codeforces Round 11


A. Co-prime Array
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
2 7 28
Output
1
2 7 9 28
----------------------------------------------------------------------------------------------------
B. Seating On Bus
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 7
Output
5 1 6 2 7 3 4
Input
9 36
Output
19 1 20 2 21 3 22 4 23 5 24 6 25 7 26 8 27 9 28 10 29 11 30 12 31 13 32 14 33 15 34 16 35 17 36 18
----------------------------------------------------------------------------------------------------
C. Hard Process
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7 1
1 0 0 1 1 0 1
Output
4
1 0 0 1 1 1 1
Input
10 2
1 0 0 1 0 1 0 1 0 1
Output
5
1 0 0 1 1 1 1 1 0 1
----------------------------------------------------------------------------------------------------
D. Number of Parallelograms
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
0 1
1 0
1 1
2 0
Output
1
----------------------------------------------------------------------------------------------------
E. Different Subsets For All Tuples
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 3
Output
6
Input
2 2
Output
14
Input
3 3
Output
174
----------------------------------------------------------------------------------------------------
F. Bear and Bowling 4
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
5 -1000 1 -3 7 -8
Output
16
Input
5
1000 1000 1001 1000 1000
Output
15003
Input
3
-60 -70 -80
Output
0
----------------------------------------------------------------------------------------------------
