/in/foo.cc: In function 'int main()':
/in/foo.cc:54:73: error: 'j' was not declared in this scope
printf("%lld ",((r==rr?0ll:val[r%pe[n]][i])+(l==ll?0ll:val[pe[n]-1][j]-val[max(0ll,l%pe[n]-1)][j]+p))%p);
^
/in/foo.cc:84:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
for(int i=1;i<n;i++)printf("%lld ",ans[i]);printf("%lld",ans[n]);
^~~
/in/foo.cc:84:46: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'for'
for(int i=1;i<n;i++)printf("%lld ",ans[i]);printf("%lld",ans[n]);
^~~~~~