using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace yukicoderTest { class Program { static void Main(string[] args) { string x = Console.ReadLine(); string y = Console.ReadLine(); string l = Console.ReadLine(); int we = int.Parse(x); int ns = int.Parse(y); int forward = int.Parse(l); int posiwe = 0; int posins = 0; int cnt = 0; if (ns < 0) { cnt++; while (posiwe != we) { if (we < 0) { if ((we * -1) - (posiwe * -1) < forward) { posiwe = we; cnt++; } else { posiwe = posiwe - forward; cnt++; } } else if (we > 0) { if (we - posiwe < forward) { posiwe = we; cnt++; } else { posiwe = posiwe + forward; cnt++; } } } while (posins != ns) { if (ns < 0) { if ((ns * -1) - (posins * -1) < forward) { posins = ns; cnt++; } else { posins = posins - forward; cnt++; } } else if (ns > 0) { if (ns - posins < forward) { posins = ns; cnt++; } else { posins = posins + forward; cnt++; } } } } else { while (posiwe != we) { if (we < 0) { if ((we * -1) - (posiwe * -1) < forward) { posiwe = we; cnt++; } else { posiwe = posiwe - forward; cnt++; } } else if (we > 0) { if (we - posiwe < forward) { posiwe = we; cnt++; } else { posiwe = posiwe + forward; cnt++; } } } while (posins != ns) { if (ns < 0) { if ((ns * -1) - (posins * -1) < forward) { posins = ns; cnt++; } else { posins = posins - forward; cnt++; } } else if (ns > 0) { if (ns - posins < forward) { posins = ns; cnt++; } else { posins = posins + forward; cnt++; } } } } Console.WriteLine(cnt); } } }