apple pie's submission of Slow Solution | CodeChef