Test case error plz guide

i had given test case for N<=1000 but getting test case error.

@Yuganshu,

https://ide.codingblocks.com/s/223967 Corrected code.

Use long instead of double.

Don’t put conditions such as: if (a[i] <= 1000) {

I have commented all the redundant lines in your code. Logic was correct.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.