consider
4
1 2 2 3
then prefix sum=>1 3 5 8
suffix sum=>3 5 7 8
possible pairs are {1,7} {3,5} {3,5}
1 3 3
series 1=>1 2 0 5
arranging(1 3 3)=> 3 3 1
series 2=>3 0 -2 7
arranging(1 3 3)=> 3 1 3
series 3=>3 -2 2 5
Next possible pair=>1 5 5
similarly i will do like above and get 3 possible arrangements
Next possible pair=>1 3 5
similarly i will do like above and get 6 possible arrangements
Next possible pair=>1 5 3
similarly i will do like above and get 6 possible arrangements
Next possible pair=>7 5 5
similarly i will do like above and get 3 possible arrangements
Next possible pair=>7 3 5
similarly i will do like above and get 6 possible arrangements
Next possible pair=>7 3 3
similarly i will do like above and get 3 possible arrangements
Next possible pair=>7 5 3
similarly i will do like above and get 6 possible arrangements
ANS=>36
IS THIS CORRECT??