Codeforces Round 679 (Div. 2, based on Technocup 2021 Elimination Round 1)


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

Examples
Input
2
2
1 100
4
1 2 3 6
Output
-100 1
1 1 1 -1
----------------------------------------------------------------------------------------------------
B. A New Technique
time limit per test: 1 second
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
2
2 3
6 5 4
1 2 3
1 6
2 5
3 4
3 1
2
3
1
3 1 2
Output
1 2 3 
6 5 4 
3 
1 
2 
----------------------------------------------------------------------------------------------------
C. Perform Easily
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 4 100 10 30 5
6
101 104 105 110 130 200
Output
0
Input
1 1 2 2 3 3
7
13 4 11 12 11 13 12
Output
7
----------------------------------------------------------------------------------------------------
D. Shurikens
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
+
+
- 2
+
- 3
+
- 1
- 4
Output
YES
4 2 3 1 
Input
1
- 1
+
Output
NO
Input
3
+
+
+
- 2
- 1
- 3
Output
NO
----------------------------------------------------------------------------------------------------
E. Solo mid Oracle
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7
1 1 1 1
2 2 2 2
1 2 3 4
4 3 2 1
228 21 11 3
239 21 11 3
1000000 1 1000000 1
Output
1
2
1
5
534
-1
500000500000
----------------------------------------------------------------------------------------------------
