While coding for competitions in codechef, I face this problem with python, to read
3 # number of required input 1 4 2 # inputs
To separate input by spaces:
data=list(map(int,input().split(' ')))
To verify wether the correct amount of numbers were passed:
if len(data) > n: # where n is your number of required input # Raise an exception or ask for the input again.