Codeforces Round 136 (Div. 2)


A. Little Elephant and Function
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
Output
1 
Input
2
Output
2 1 
----------------------------------------------------------------------------------------------------
B. Little Elephant and Numbers
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
Output
1
Input
10
Output
2
----------------------------------------------------------------------------------------------------
C. Little Elephant and Problem
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
1 2
Output
YES
Input
3
3 2 1
Output
YES
Input
4
4 3 2 1
Output
NO
----------------------------------------------------------------------------------------------------
D. Little Elephant and Array
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7 2
3 1 2 2 3 3 7
1 7
3 4
Output
3
1
----------------------------------------------------------------------------------------------------
E. Little Elephant and Shifts
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
1 2
2 1
Output
1
0
Input
4
2 1 3 4
3 4 2 1
Output
2
1
0
1
----------------------------------------------------------------------------------------------------
