PROBLEM CODE:MUFFINS3

Please check where exactly my code went wrong
N=int(input())
cc=[]
for i in range(N):
a=int(input())
cc.append(a)
cc.sort()
sm=cc[0]
print(sm)
d=0
for i in range(1,N):
diff=cc[i]-sm
if(diff>d):
d=diff
print(d)

As far as my understanding, I deveoped this code, if I’ve misunderstood the question,kindly please explain it to me.

Your logic is incorrect.
Have a look at my solution:
https://www.codechef.com/viewsolution/24939853
Hope that this helps