BETA
Divisibility by 999
Submissions: 534   Accuracy:

37.27%

  Difficulty: Easy
       

You are given an n-digit large number, you have to check whether it is divisible by 999 without dividing or finding modulo of number by 999.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains an string denoting the number.

Output:
Print "Divisible" (without quotes) if the number is divisible by 999.
Print "Not divisible" (without quotes) if the number is not divisible by 999.

Constraints:
1<=T<=10^5
1<=length of string<=10^9

Example:
Input:

2
1998
999999999

Output:
Divisible
Not divisible

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Ayush Govil
Author: Ayush Govil 1


Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.