apple pie's submission of Distinct Dilemma | CodeChef