def func(x,n):
an = x
a0 = n
d = n - 1
return (an-a0)/d + 1
import sys
input_data = sys.stdin.readlines()
i = 1
t = int(input_data[0])
while i <= t:
x,n = map(int,input_data[i].split())
items = x
items += func(x,n)
print items
i += 1
System Design for Beginners
A masterclass that helps early engineers and product managers become great at designing scalable systems.
132+ learners
Details →System Design Masterclass
A masterclass that helps you become great at designing scalable, fault-tolerant, and highly available systems.
1000+ learners
Details →Redis Internals
Learn internals of Redis by re-implementing some of the core features in Golang.
98+ learners
Details →