RE NZEC ERROR IN PYTHON 3.6

As I’m pretty much new to programming.I tried something.It’s working fine on codechef ide when I ran it with custom inputs. but on submission it is RE NZEC error.I don’t know what it is.can anybody please help me with that.
I’m linking my code down for reference:
https://www.codechef.com/viewsolution/23619920

You are getting the array wrong way. In Python instead of:

for j in range(0,n):
	x=int(input())
	arr.append(x)

use:

arr = [int(k) for k in input().split()]
or,
arr = list(map(int, input().split()))

//