Hackerrank Nov 20/20: Utopian Tree

Simple math. O(1) solution.