link of my code
Not able to submit answer
Runtime error is due to the size of the array which is declared as 10. You can define array A after taking input of n and writing int A[n]. Then your code should work just fine.
Hope it Helps.
still not submiting sir
facing same problem for rain water harvesting too