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:
- \(S1 = ∑Ai1\) where \(Ai1\) are the elements positioned at an odd position in an array
- \(S2 = ∑Ai2\) where \(Ai2\) are the elements positioned at an even position in an array
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<10^9\))
Output format
Print that minimum possible product of the beauty of those two arrays.
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial