The first line contains an integer n (1 ≤ n ≤ 106) — the number of array elements. The second line contains n space-separated integers a1, ..., an (1 ≤ ai ≤ 109).
Tests are divided into several groups, but are evaluated separately.
-
n, ai ≤ 1000 – 10 points
-
n ≤ 5000 – 10 points
-
n ≤ 106 ai ≤ 5000 – 30 points
-
Without additional restrictions — 50 points
For example, if you solve a problem for n ≤ 5000 and arbitrary ai you will get 20 points (first and second groups).