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) 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+ learnersDetails →
System Design Masterclass
A masterclass that helps you become great at designing scalable, fault-tolerant, and highly available systems.
1000+ learnersDetails →
Learn internals of Redis by re-implementing some of the core features in Golang.
98+ learnersDetails →