Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

cutting recipes

$
0
0
t=int(input())

i=0

if(t<=100):

for i in range(t):

    f=[]
    f= list(map(int, input().split()))
    l=f[0]
    if((l>=2)and(l<=50)):
         f.remove(f[0])
         def gcd(x,y):
             rem=x%y
             while(rem!=0):
                 x=y
                 y=rem
                 rem=x%y
             return y

             j=0
    for j in range(l-1):
        a=gcd(f[j],f[j+1])
        if(a==1):
            break
        new=' '
    for j in range(l):
        ele=f[j]//a
        new+=str(ele)+' '
    print(new.strip())

whats wrong with this code????!!!!


Viewing all articles
Browse latest Browse all 40121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>