Bear and Bribing Tree | CodeChef