Alternative Thinking

CodeForces - 604C