ricehub.cpp: In function 'int besthub(int, int, int*, long long int)':
ricehub.cpp:8:23: error: 'n' was not declared in this scope
8 | long long pre[n+1]={};
| ^
ricehub.cpp:9:35: error: 'pre' was not declared in this scope
9 | for(int i = 0; i< n; i++) pre[i+1]=pre[i]+x[i];
| ^~~
ricehub.cpp:9:51: error: 'x' was not declared in this scope
9 | for(int i = 0; i< n; i++) pre[i+1]=pre[i]+x[i];
| ^
ricehub.cpp:17:42: error: 'pre' was not declared in this scope
17 | cnt+=(k - i)*X[k] - (pre[k] - pre[i]) + (pre[i+m] - pre[k +1]) - (i+m - k)*pre[k]
| ^~~