n=0
k=[]
q=[]
j=0
if n!=-1
p=gets
n=p.to_i
for i in (1..n)
l=gets
k[i]=l.to_i
a=a+k[i]
end
if a%n !=0
q[j] = -1
continue
end
a=a/n
for i in (1..n)
if k[i] >a
q[j]=q[j]+(a-k[i])
end
end
j=j+1
end
for i in (1..j)
puts(q[j])
end
it gives me errors like this line 23 .. unexpected end line 26 unexpected end .. can any one debug ?
i have put identations now .. its in ruby !!
my inputs are in integers!!