Good Program solution 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.

Good Program solution 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 Good Program solution codechef

  • 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).

Good Program solution codechef Constraints

  • 1T10001≤T≤1000
  • 1N10001≤N≤1000

Subtasks

Subtask #1 (100 points): original constraints

Sample Input 1 

4
8
17
52
3

Sample Output 1 Good Program solution codechef

Good
Not Good
Good
Not Good

Explanation

Test case 1: The program requires 88 bits of memory. This is equivalent to 84=284=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.25174=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=13524=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.7534=0.75 nibbles. Since 0.750.75 is not an integer, this program is not good.

SOLUTION – CLICK HERE

Leave a Comment

Your email address will not be published.