Function to count the unique sum
static int count_unique_sum ( int n ) { int i ; int [ ] ar = new int [ n + 1 ] ; int [ ] fsum = new int [ n + 1 ] ; int [ ] rsum = new int [ n + 1 ] ; int ans = 1 ; for ( i = 0 ; i <= n ; i ++ ) { ar [ i ] = i ; }