#include <algorithm> #include <cstring> #include <iostream> using namespace std; typedef long long LL ; int main() { int n; cin >> n; LL arr[n], sum[n]; memset(sum, 0, sizeof(sum)); for (int i = 0; i < n; i++) { cin >> arr[i]; sum[...