Minimum and maximum numbers
Practice
4.6 (5 votes)
Mathematics
Basic math
Math
Problem
93% Success 1182 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code
Consider the following infinite full BST (Binary Search Tree) as shown in the figure.
You are required to find what is the minimum and maximum number in the subtree of the given node (including the node).
Input format
- The first line of input contains the number of test cases denoted by T.
- The first line of each test case contains 1 integer N denoting a node in the tree.
Output format
Print two integers containing minimum and maximum number in the subtree of the given node (including the node).
Constraints
\(1 \leq T \leq 10\)
\(1 \leq N \leq 10^{10}\)
Submissions
Please login to view your submissions
Similar Problems
Points:30
1 votes
Tags:
Easy-Medium
Points:30
9 votes
Tags:
Basic MathAlgorithmsMath
Points:30
Tags:
Easy-Medium
Editorial