Sum of Digits Divisibility
Submissions: 4872   Accuracy:

39.01%

  Difficulty: Basic   Marks: 1

Check that the number can be divided by the sum of its digit.

Input:

The first line of input contains an integer T denoting the number of test cases.Then T test cases follow .Each test case consist of an integer N.

Output:

Print 1 if divisible else 0.

Constraints:

1 ≤ T ≤ 100
1 ≤ N ≤ 100000

Example:

Input
2
18
19170

Output
1
1

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

Author: rajatjha


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.



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


to report an issue on this page.