You are given an integer N. You have total 2N stones numbered from 1 to 2N. You have initially two empty arrays of size N each. You have to fill both the arrays utilizing all the 2N stones and using each stone in only one array.
Let us define the beauty of an array as the difference between the sum of elements at odd positions and the sum of elements at even positions.
The beauty of an array is |S1−S2| where:
Your task is to arrange the stones in both arrays such that the product of the beauty of both arrays is as minimum as possible.
Input format
A single integer representing N (0<N<109)
Output format
Print that minimum possible product of the beauty of those two arrays.
Since N = 5, we have stones 1,2,3,4,5,6,7,8,9,10.
We can arrange the stones in this way
Array 1: [1,2,3,7,5]
Here, the beauty = |(1+3+5)-(2+7)| = |9-9| = 0
So beauty = 0
Array 2 : [6,4,8,9,10] :
Here, the beauty = |(6+8+10)-(4+9)| = |24-13| = 11
So beauty = 11
So that the Product is minimum possible.
Product = 0*11 = 0