HELP IN PRMQ PROBLEM OF JUNE CHALLENGE!

Link of my solution: CodeChef: Practical coding for everyone
I don’t know where my implementation is going wrong. I tried many test cases, but no luck :frowning:
Can someone provide me some test cases or point out the mistake in my code.

Take this test case-

Input
10
1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000
1
1 9 1 100
Your Output
0
Correct Output
108

Thanks. It worked :slight_smile: