I’m getting runtime error NZEC, but the code runs fine on my IDE. Can anyone please explain?
The link to problem is : https://www.spoj.com/problems/CANDY3
t = int(input()) while t: print("\n") t = t-1 n = int(input()) sum = 0 for i in range(n): c = int(input()) sum = sum + c if (sum%n)==0: print("YES") else: print("NO")
When I run it on ideone, it reports
ValueError: invalid literal for int() with base 10: ‘’
because you’re not handling the blank line before each test case.
I added print("\n"), in the first line in while loop to add a blank line before each test case, but I’m still getting the same error.
Not outputting a blank line, but you need to ignore the blank between test cases in the input.