A, B, and C are three friends. Their birth dates are in the ratio of 1:2:4. B forms a quadratic equation of the form ax2+bx+c, where the coefficient a,b, and c are the birth date ratios, that is, a=1, b=2, and c=4.
C is preparing for a test, he gives n online tests and stores the score of these n tests in the form of an array. C wants to arrange the scores of these n tests in a non-decreasing order such that he can show it to his friends about his improvement. He uses the following operation to perform this task:
Determine the minimum number of operations required to perform the task.
Input format
Output format
Print a single integer that represents the minimum number of operations that can be performed to complete the task. If it is not possible, then print −1.
Constraints
1≤n≤2000001≤Ai≤1e9
Array after each ALPHA Operation would be:
ALPHA Operation 1: 3,1,4,−2
ALPHA Operation 2: −6,1,4,−2
ALPHA Operation 3: −6,1,4,4