it is given that x,y,z will be less than equal to 1000 that’s not the case as

I added the condition that if any one was greater than 1000 then don’t consider but when I remove it it got me AC.This mistake in constraints and test data has got me too much penalty(due to WA) which is totally unfair to me and all those who faced this problem.

So the time penalty should be removed from this problem and be 0 for everyone