Kotlin Heroes: Practice 10


A. Spy Detected!
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
4
11 13 11 11
5
1 4 4 4 4
10
3 3 3 3 10 3 3 3 3 3
3
20 20 10
Output
2
1
5
3
----------------------------------------------------------------------------------------------------
B. Compare T-Shirt Sizes
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
XXXS XS
XXXL XL
XL M
XXL XXL
XXXXXS M
L M
Output
<
>
>
=
<
>
----------------------------------------------------------------------------------------------------
C. Count the Number of Pairs
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
11 2
aAaaBACacbE
2 2
ab
4 1
aaBB
6 0
abBAcC
5 3
cbccb
Output
5
0
1
3
2
----------------------------------------------------------------------------------------------------
D. Traffic Light
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
5 r
rggry
1 g
g
3 r
rrg
5 y
yrrgy
7 r
rgrgyrg
9 y
rrrgyyygy
Output
3
0
2
4
1
4
----------------------------------------------------------------------------------------------------
E. Jumping on Tiles
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
logic
codeforces
bca
aaaaaaaaaaa
adbaadabad
to
Output
9 4
1 4 3 5
16 10
1 8 3 4 9 5 2 6 7 10
1 2
1 3
0 11
1 8 10 4 3 5 7 2 9 6 11
3 10
1 9 5 4 7 3 8 6 2 10
5 2
1 2
----------------------------------------------------------------------------------------------------
F. Sending a Sequence Over the Network
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7
9
1 1 2 3 1 3 2 2 3
5
12 1 2 7 5
6
5 7 8 9 10 3
4
4 8 6 2
2
3 1
10
4 6 2 1 9 4 9 3 4 2
1
1
Output
YES
YES
YES
NO
YES
YES
NO
----------------------------------------------------------------------------------------------------
G. The Humanoid
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
8
4 1
2 1 8 9
3 3
6 2 60
4 5
5 1 100 5
3 2
38 6 3
1 1
12
4 6
12 12 36 100
4 1
2 1 1 15
3 5
15 1 13
Output
4
3
3
3
0
4
4
3
----------------------------------------------------------------------------------------------------
H. Count the Trains
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
4 2
6 2 3 7
3 2
4 7
5 4
10 13 5 2 6
2 4
5 2
1 5
3 2
13 4
769 514 336 173 181 373 519 338 985 709 729 702 168
12 581
6 222
7 233
5 117
Output
3 4 
4 4 2 3 
5 6 6 5 
----------------------------------------------------------------------------------------------------
