apple pie's submission of Valid Minimum | CodeChef