fork(2) download
  1. t=int(input())
  2. while(t>0):
  3. t=t-1
  4. arr=input().split() #if x and n in same line!!!!
  5. x=int(arr[0])
  6. n=int(arr[1])
  7. print (int(x+(x/(n-1))-x%n))
Success #stdin #stdout 0.06s 9568KB
stdin
1
10 2
stdout
20