Bui Nguyen Ngoc Thang's submission of ATM | CodeChef