Cut the Sheet
Practice
3.3 (3 votes)
Math
C++
Basic math
Observation
Problem
39% Success 501 Attempts 10 Points 1s Time Limit 256MB Memory 1024 KB Max Code
Bob is initially given one sheet of width \(W\) and height \(H\). He wants to make at least \(N\) pieces from the sheet. He can cut any sheet into two equal pieces along any side of the rectangular sheet such that the value of width and height of the resultant pieces always remain an integer. For example, If the sheet has \(2X2\) dimensions, he can make two pieces of \(1X2\) dimensions or two of \(2X1\) dimensions.
Print \(Yes\) if Bob is able to make at least \(N\) pieces or \(No\) otherwise.
Input Format:
- The first line contains an integer \(T\), which denotes the number of test cases.
- The first line of each test case contains three integers \(W\), \(H\), and \(N\) denoting the dimensions of the sheet and the least number of pieces Bob has to make.
Output Format:
For each test case, print \(Yes\) if Bob is able to make at least \(N\) pieces or \(No\) otherwise.
Constraints:
\(1 \leq T \leq 10^5 \\ 1 \leq W,H \leq 10^9 \\ 1 \leq N \leq 10^{18}\)
Submissions
Please login to view your submissions
Similar Problems
Points:10
29 votes
Tags:
Very-Easy
Points:10
32 votes
Tags:
Basic ProgrammingBasic MathBasics of ImplementationImplementationMath BasicArithmetic operationsMath
Points:10
23 votes
Tags:
Very-EasyMathematicsBasic MathSimple-mathMathematics
Editorial