Calculate the fraction
Practice
3 (1 votes)
Hard
Recruit
Grammar Verified
Ready
Mathematics
Approved
Mathematics
Mathamatics
Problem
76% Success 39 Attempts 50 Points 1s Time Limit 256MB Memory 1024 KB Max Code
There are three decimal numbers, namely X, Y, and Z. You are given the value of X in the form of xx.xx.
Write a program to find the minimum value of Z such that Y is either floor (ZX/100) or ceil (ZX/100) and \(Y/Z\) rounds off to the given value of X, i.e. upto two decimal places.
Input format
- First line: T (number of test cases)
- First line in each test case: X, either in the form \(xx.xx\) or \(xx.xxx\)
Output format
For each test case, print the minimum value of Z such that Y is either floor (ZX/100) or ceil (ZX/100) and \(Y/Z\) rounds off to the given value of X, i.e. upto two decimal places.
Note:
All values of X are rounded off to the nearest hundredth. In case the difference is equal to 0.005, round up.
Constraints
\(1 ≤ T ≤ 10000\)
\(00.00 ≤ X ≤ 99.99\)
Submissions
Please login to view your submissions
Similar Problems
Points:30
23 votes
Tags:
AlgorithmsMedium
Points:50
Tags:
HardMath
Points:50
2 votes
Tags:
ReadyMathematicsHardApprovedSqrt-DecompositionMathematicsMathamatics
Editorial