https://medium.com/@eyajamuehaque/1097a-gennady-and-a-card-game-codeforces-solution-in-c-b0c704a6827f