Codeforces Round 276 (Div. 2)


A. Factory
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 5
Output
No
Input
3 6
Output
Yes
----------------------------------------------------------------------------------------------------
B. Valuable Resources
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
0 0
2 2
Output
4
Input
2
0 0
0 3
Output
9
----------------------------------------------------------------------------------------------------
C. Bits
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 2
2 4
1 10
Output
1
3
7
----------------------------------------------------------------------------------------------------
D. Maximum Value
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
3 4 5
Output
2
----------------------------------------------------------------------------------------------------
E. Strange Sorting
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
qwerty
3
4 2
6 3
5 2
Output
qertwy
qtewry
qetyrw
----------------------------------------------------------------------------------------------------
