Codeforces Beta Round 75 (Div. 2 Only)


A. Chips
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 11
Output
0
Input
17 107
Output
2
Input
3 8
Output
1
----------------------------------------------------------------------------------------------------
B. Binary Number
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
Output
0
Input
1001001
Output
12
Input
101110
Output
8
----------------------------------------------------------------------------------------------------
C. Newspaper Headline
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
abc
xyz
Output
-1
Input
abcd
dabc
Output
2
----------------------------------------------------------------------------------------------------
D. Queue
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
10 8 5 3 50 45
Output
2 1 0 -1 0 -1 
Input
7
10 4 6 3 2 8 15
Output
4 2 1 0 -1 -1 -1 
Input
5
10 3 1 10 11
Output
1 0 -1 -1 -1 
----------------------------------------------------------------------------------------------------
E. Ski Base
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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