• + 3 comments

    Yeah, I cannot see a way to make this a one-liner, can you?

    for _ in range(int(input())):
        n,c,m=map(int,input().split())
        print(n//c+(n//c-1)//(m-1))