The complexity is O(kn) I would expect it to TLE instead. You should try thinking of a faster approach.
I hope you know kn is 10^14 calculations, which the codechef judge would take 3 hours.
After a bit of observation, I noticed that
if k%2==1
seq[i]=max(seq)-seq[i]
if k%2==0 && k!=0
seq[i]=seq[i]-min(seq)