type Player = Black | White let simulate n k = (n - 1) % (k + 1) |> function | 0 -> White | _ -> Black let ans = let mutable cnt = 0 for i in 1 .. 1000 do let t = stdin.ReadLine().Split() |> Array.map int simulate t.[0] t.[1] |> function | Black -> cnt <- cnt + 1 | _ -> () cnt ans |> stdout.WriteLine