Print the answer for the following code:
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
long long ans = 0;
for (int i = 1; i <= n; i++) {
long long sum = 0;
for (int j = i; j <= n; j++) {
sum += a[j];
ans ^= sum;
}
}
cout << ans;The first line contains a single integer n~(1 \le n \le 3 \cdot 10^5) — the number of elements in the array.
The second line contains integers a_1, a_2, ..., a_n~(0 \le a_i \le 10^9).
Print the answer for the given code.
Example 1