private int equi(int arr[], int n) {
            if (n==0) return -1;
            long sum = 0;
            int i;
            for(i=0;i<n;i++) sum+=(long) arr[i];

            long sum_left = 0;
            long diff = 1001;
            int P = -1;
            for(i=0;i<n;i++) {
                System.out.println("" + i + " " +arr[i]);
                sum_left += (long) arr[i];
                long tempDiff = Math.abs(sum_left - (sum - sum_left));
                if (diff > tempDiff) {
                    P = i;
                    diff = tempDiff;
                }
            }
            return (int)diff;
        }