Dividing array problem


I am not able to pass the test cases
how to solve this problem

@vivekpatel

int j = n - 1;
	for (int i = 0; i < N; i++) {
		maxans += abs(arr[i] - arr[j--]);
	}

and use long long