Where is the Pizza?

CodeForces - 1670C