CodechefApr 28, 2025

Good Program

Hazrat Ali

Codechef

In computing, the collection of four bits is called a nibble.

Chef defines a program as:

  • Good, if it takes exactly XX nibbles of memory, where XX is a positive integer.
  • Not Good, otherwise.

Given a program which takes NN bits of memory, determine whether it is Good or Not Good.

Input Format

  • First line will contain TT, number of test cases. Then the test cases follow.
  • The first and only line of each test case contains a single integer NN, the number of bits taken by the program.

Output Format

For each test case, output GoodGood or Not GoodNot Good in a single line. You may print each character of GoodGood or Not GoodNot Good in uppercase or lowercase (for example, GoOdGoOdGOODGOODgoodgood will be considered identical).

Constraints

  • 1≤T≤1000
  • 1≤N≤1000

Subtasks

Subtask #1 (100 points): original constraints

Sample 1:

Input
 
4
8
17
52
3
 
Output
 
Good
Not Good
Good
Not Good

Explanation:

Test case 1: The program requires 88 bits of memory. This is equivalent to 84=2 nibbles. Since 22 is an integer, this program is good.

Test case 2: The program requires 1717 bits of memory. This is equivalent to 174=4.25 nibbles. Since 4.254.25 is not an integer, this program is not good.

Test case 3: The program requires 5252 bits of memory. This is equivalent to 524=13 nibbles. Since 1313 is an integer, this program is good.

Test case 4: The program requires 33 bits of memory. This is equivalent to 34=0.75 nibbles. Since 0.750.75 is not an integer, this program is not good.

 

Solution

for _ in range(int(input())):
    m = int(input())
    if m%4==0:
        print("Good")
    else:
        print("Not Good")

 

Comments