The principal line contains one integer t (1≤t≤104) — the number of experiments. Then, at that point, t experiments follow.    Each experiment comprises of one line containing three integers w, h, n (1≤w,h≤104,1≤n≤109) — the width and stature of the sheet Polycarp has and the number of companions he wants to send a postcard to.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Correct answer will be upvoted else downvoted. Computer science.

 

 Polycarp can cut any piece of paper w×h that he has in just two cases: 

 

On the off chance that w is even, he can slice the sheet down the middle and get two sheets of size w2×h; 

 

In the event that h is even, he can slice the sheet down the middle and get two sheets of size w×h2; 

 

On the off chance that w and h are even simultaneously, Polycarp can slice the sheet as indicated by any of the standards above. 

 

In the wake of cutting a piece of paper, the complete number of pieces of paper is expanded by 1. 

 

Assist Polycarp with seeing whether he can cut his sheet of size w×h at into n or more pieces, utilizing just the principles portrayed previously. 

 

Input 

 

The principal line contains one integer t (1≤t≤104) — the number of experiments. Then, at that point, t experiments follow. 

 

Each experiment comprises of one line containing three integers w, h, n (1≤w,h≤104,1≤n≤109) — the width and stature of the sheet Polycarp has and the number of companions he wants to send a postcard to. 

 

Output 

 

For each experiment, output on a different line: 

 

"Indeed", in case it is feasible to cut a sheet of size w×h into basically n pieces; 

 

"NO" in any case. 

 

You can output "YES" and "NO" regardless (for instance, the strings yEs, indeed, Yes and YES will be perceived as sure).

 

 

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Uncertainty Problems
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education