Write a program to check whether a number is wierd or not. A weird number is weird if the sum of the proper divisors (divisors including 1 but not itself) of the number is greater than the number, but no subset of those divisors sums to the number itself.

Example:

The smallest weird number is 70. Its proper divisors are 1, 2, 5, 7, 10, 14, and 35; these sum to 74, but no subset of these sums to 70. The number 12, for example, is *not* weird, because the proper divisors of 12 are 1, 2, 3, 4, and 6, sum of divisors is 16; but there is a subset {2, 4, 6} with sum 12, i.e., 2+4+6 = 12.

**Input:**

First line contains number of test cases T. Then following T lines contains an integer N.

**Output:**

Output "Weird" if given number is strong else "Not Weird" .

**Constraints:**

1<=T<=100

2<=N<=10000

**Example:**

**Input:**

2

5

70

Output:

Not Weird

Weird

Author: dipjal1996

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Sulagna | 117 |

RUTVIKHARIPARA | 116 |

janvidavda105190 | 93 |

harshsiddhapura105461 | 93 |

madhursengar24 | 86 |

PiyushPandey4 | 617 |

ASWATHAMA | 561 |

akhyasharma01 | 547 |

john_wick | 521 |

jagrit_07 | 448 |

blackshadows | 5362 |

Ibrahim Nash | 5242 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4598 |

Login to report an issue on this page.