N,X,Y,*A=`dd`.split.map &:to_i B=[] s=0 (1<0} q=Y/r-(X-1)/r if d%2>0 s+=q*d else s-=q*d end } p s