You are viewing a single comment's thread. Return to all comments →
Short Python solution with lambda function
function = lambda n,c,m : n//c + 1/(m-1) * (n/c) - 1/(m-1)
t = int(input().strip())
for a0 in range(t):
n,c,m = input().strip().split(' ')
n,c,m = [int(n),int(c),int(m)]
Amazing, lad. Congrats. You really showed them how it's done.
why are you deviding by m-1? Please could you explain me this code in breif...