Codeforces Round 729 (Div. 2)


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

Examples
Input
5
2
2 3 4 5
3
2 3 4 5 5 5
1
2 4
1
2 3
4
1 5 3 2 6 7 3 4
Output
Yes
No
No
Yes
No
----------------------------------------------------------------------------------------------------
B. Plus and Multiply
time limit per test: 3 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
5
24 3 5
10 3 6
2345 1 4
19260817 394 485
19260817 233 264
Output
Yes
No
Yes
No
Yes
----------------------------------------------------------------------------------------------------
C. Strange Function
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
1
2
3
4
10
10000000000000000
Output
2
5
7
10
26
366580019
----------------------------------------------------------------------------------------------------
D. Priority Queue
time limit per test: 3 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4
-
+ 1
+ 2
-
Output
16
Input
15
+ 2432543
-
+ 4567886
+ 65638788
-
+ 578943
-
-
+ 62356680
-
+ 711111
-
+ 998244352
-
-
Output
750759115
----------------------------------------------------------------------------------------------------
E1. Abnormal Permutation Pairs (easy version)
time limit per test: 1 second
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4 403458273
Output
17
----------------------------------------------------------------------------------------------------
E2. Abnormal Permutation Pairs (hard version)
time limit per test: 4 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4 403458273
Output
17
----------------------------------------------------------------------------------------------------
