“0 x y : This denotes that the chef containing dish number x competes with the chef containing dish number y currently in this round. If a single chef is the owner of both the dishes, print “Invalid query!” (without quotes), otherwise execute and store the result of this round as described by the rules above.” What if x(or y) has lost all his dishes to some other chef z…is that a valid query?

please note that …x and y are dishes not the owners …so there will always be an owner to x or y …hope it helps …:slight_smile:

yes, I got that later.
Please delete the question.