#36079: Python AC


henry.curry1008@gmail.com (Henry Huang)

School : 政治大學
ID : 230876
IP address : [123.192.90.206]
Last Login :
2023-07-24 14:11:18
a536. 11689 - Soda Surpler -- UVa11689 | From: [123.192.90.206] | Post Date : 2023-07-04 16:09

n = int(input())
for i in range(n):
    a, b, c = map(int,input().split())
    count = 0
    cola = a + b
    while(cola//c):
        count += cola//c
        cola = cola//c + cola%c
    print(int(count))

 
ZeroJudge Forum