using System; namespace y { class Program { static void Main(string[] args) { for (int i = 0; i < 1000; i++) { int cnt = 0; var ss = Console.ReadLine().Split(); if (N(int.Parse(ss[0]), int.Parse(ss[1]))) cnt++; Console.WriteLine(cnt); } } static bool N(int n,int k) { int f = (n - 1) % (k + 1); if (f == 0) return true; else return false; } } }