Technocup 2017 - Elimination Round 1 (Unofficially Open for Everyone, Rated for Div. 2)


A. Transformation: from A to B
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 162
Output
YES
5
2 4 8 81 162 
Input
4 42
Output
NO
Input
100 40021
Output
YES
5
100 200 2001 4002 40021 
----------------------------------------------------------------------------------------------------
B. Bill Total Value
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
chipsy48.32televizor12.390
Output
12.438.32
Input
a1b2c3.38
Output
6.38
Input
aa0.01t0.03
Output
0.04
----------------------------------------------------------------------------------------------------
C. Guess the Array
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
 
9
 
7
 
9
 
11
 
6
 
Output
 
? 1 5
 
? 2 3
 
? 4 1
 
? 5 2
 
? 3 4
 
! 4 6 1 5 5
----------------------------------------------------------------------------------------------------
D. T-shirts Distribution
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
0 1 0 1 1 0
3
XL
S,M
XL,XXL
Output
YES
XL
M
XXL
Input
1 1 2 0 1 1
5
S
M
S,M
XXL,XXXL
XL,XXL
Output
NO
----------------------------------------------------------------------------------------------------
E. Games on a CD
time limit per test: 4 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
3 1
abc
4
b
a
c
d
Output
YES
2 1 3 
Input
4 2
aabbccdd
4
dd
ab
bc
cd
Output
NO
----------------------------------------------------------------------------------------------------
F. Polycarp's problems
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6 3
8 -5 -4 1 -7 4
0 7 3
Output
2
0
1
----------------------------------------------------------------------------------------------------
