0% found this document useful (0 votes)
21 views

Variables Using Python

Uploaded by

Madhu Painkiller
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Variables Using Python

Uploaded by

Madhu Painkiller
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

t =int(input())

for i in range(t):
n, m, k = map(int, input().split())
l=[0 for i in range(k)]
d = n // k
if m<d:
l[0]=m
else:
l[0]=d
m=m-d
while(m!=0):
for i in range(1,k):
if m!=0:
l[i]+=1
m-=1
if m==0:
break

print(l[0]-l[1])

You might also like