Height of the left tree
Execution time limit is 2 seconds
Runtime memory usage limit is 256 megabytes
In a suspended binary tree, the potential of a vertex is defined as the shortest distance to a vertex with fewer than two children. A tree is considered left if, for each vertex, the potential of the left child is not less than that of the right child. Furthermore, no vertex should have a right child without also having a left child.
The height of a tree is the number of vertices on the longest path from the root to a leaf.
Given a number of vertices N, determine the height of both the tallest and the shortest left tree.
Input
You are provided with a single integer, N, representing the number of vertices in the tree (1 ≤ N ≤ 10_9).
Output
Output two integers: the height of the tallest left tree and the height of the shortest left tree.
Examples
Input #1
Answer #1
Submissions 69
Acceptance rate 41%