.12 second on Which cluster?..Here the problem will be judge on pyramid cluster which is 30 times slower than cube.
some suggestion for AC use one more precomputation for the final result.
[code] scanf("%llu",&n);
for(unsigned long long i=1;i<=n;i++){
sum = sum + a[i]%MOD;
} [/code]
here for loop is running up to n for every input, why don'y you again precompute the final answer in another array and print it in o(1).