Educational Codeforces Round 14


A. Fashion in Berland
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 0 1
Output
YES
Input
3
1 0 0
Output
NO
----------------------------------------------------------------------------------------------------
B. s-palindrome
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
oXoxoXo
Output
TAK
Input
bod
Output
TAK
Input
ER
Output
NIE
----------------------------------------------------------------------------------------------------
C. Exponential notation
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
16
Output
1.6E1
Input
01.23400
Output
1.234
Input
.100
Output
1E-1
Input
100.
Output
1E2
----------------------------------------------------------------------------------------------------
D. Swaps in Permutation
time limit per test: 5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
9 6
1 2 3 4 5 6 7 8 9
1 4
4 7
2 5
5 8
3 6
6 9
Output
7 8 9 4 5 6 1 2 3
----------------------------------------------------------------------------------------------------
E. Xor-sequences
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 2
15 1 2 4 8
Output
13
Input
5 1
15 1 2 4 8
Output
5
----------------------------------------------------------------------------------------------------
F. Couple Cover
time limit per test: 3 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
5
4 2 6 1 3
4
1 3 5 8
Output
20
18
14
10
Input
2
5 6
2
30 31
Output
2
0
----------------------------------------------------------------------------------------------------
