import sequtils,strutils var res = 0 for _ in 1..1000: let (n,k) = (let t = stdin.readline().split().map(parseInt);(t[0],t[1])) # n - 1 == a * (k + 1) の時敗北 if (n - 1) mod (k + 1) != 0: res += 1 echo res