eval'K,X,Y='+`dd`.split*?,
x,y,*s=X.abs,Y.abs
d=x+y
x,y=y,x if f=x<y
K%2-d%2<0&&p(-1)+exit
d!=K&&(L=[~-d/K,1].max+1
L+=1&d-K*L
v=K>(t=K*L-d>>1)?0:t-t=K
a=K-t
2.upto(L){s<<[a,-t]
a+=q=[x+v-a,K].min
t-=K-q})
s<<[x,y]
p s.size
s.map{|a,b|a,b=b,a if f
p a*=X<=>0.1,b*=Y<=>0.1}