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
n=1+~-d/K
n+=d<K ? 1:d-n*K&1
a=n<2?x:d-n*K>>1
b=K-a.abs
d%2-d/K>0&&(s<<[0,-K]
a=b=d-K>>1)
n.times{s<<[a,b]
a+=t=[x-a,K].min
b+=K-t}
p s.size
s.map{|a,b|a,b=b,a if f
p a*=X<=>0.1,b*=Y<=>0.1}