WA in RECIPE

Hi,

the following code has passed all the given test cases however I am not able to submit it.

tc = int(input())
for x in range(tc):
    num = list(map(int,input().split(' ')))
    small =num[1]
    case =0
    num_sort =[]
    for i in range(1,len(num)):
        for j in range(1,len(num)):
            if num[j]<small:
                small = num[j]
        if num[i]%small==0:
            num_sort.append(int(num[i]/small))
            case = 1
        else :
            case =0
            print(*num[1:])
            break
        
    if case==1:
        print(*num_sort)

can someone tell me why? I can ofcourse use an alternate way, but why doesnt this work

Consider the testcase:

1
9 404 504 452 460 308 660 844 256 728
3 Likes

aha! my bad got it. Thank you.

1 Like