0% found this document useful (0 votes)
20 views1 page

Variables Using Python

Uploaded by

Madhu Painkiller
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download as txt, pdf, or txt
0% found this document useful (0 votes)
20 views1 page

Variables Using Python

Uploaded by

Madhu Painkiller
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download as txt, pdf, or txt
Download as txt, pdf, or txt
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