Sharad Agarwal's submission of ATM | CodeChef