luogu#P7892. 『JROI-3』田径
『JROI-3』田径
Background
You are getting ready to play MC.
Problem Description
You need to use fences to enclose a rectangular area. Suppose this rectangle has size pixel cells. Then you need a fence frame of size in length and in width to enclose this area.
Now you find that your sheep and cows need exactly pixel cells to survive, and you have fences in your backpack. You want to know whether, with the fences you have, you can enclose pixel cells.
You do not need to use up all fences. As long as you can enclose a rectangle whose area is pixel cells.
Note that above must all be integers.
Input Format
The first line contains an integer , the number of test cases.
The next lines each contain two integers , as described.
Output Format
Output one string per line. If it is possible, output Good; otherwise, output Miss.
2
4 1
4 20
Miss
Good
Hint
Sample 1 Explanation
First test case:
It can be verified that it is impossible to use fence to enclose pixel cells.
Second test case:
You can consider enclosing pixel cells as follows.

Using the method below only requires fences.

The fence width is , the length is , and .
Constraints and Notes
This problem uses bundled tests.
- Subtask 1 (30 pts): , ;
- Subtask 2 (70 pts): , .
In this problem, fences are abstract rather than concrete. That is, a fence will degenerate into a point rather than a cell. So we can compute how many fences a fence frame consumes by computing the perimeter (if you do not understand, you can look at the Sample 1 explanation).
Translated by ChatGPT 5