Codeforces Round 177 (Div. 1)


A. Polo the Penguin and Strings
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7 4
Output
ababacd
Input
4 7
Output
-1
----------------------------------------------------------------------------------------------------
B. Polo the Penguin and Houses
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 2
Output
54
Input
7 4
Output
1728
----------------------------------------------------------------------------------------------------
C. Polo the Penguin and XOR operation
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
Output
20
0 2 1 4 3
----------------------------------------------------------------------------------------------------
D. Polo the Penguin and Trees
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1 2
2 3
3 4
Output
2
----------------------------------------------------------------------------------------------------
E. Polo the Penguin and Lucky Numbers
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
7
Output
28
Input
474
777
Output
2316330
----------------------------------------------------------------------------------------------------
