Kevin Sun's submission of Math Hatter | CodeChef