Divisible by 8 (Contest)
Divisible by 8 easy Time Limit: 2 sec Memory Limit: 128000 kB
Last updated
Divisible by 8 easy Time Limit: 2 sec Memory Limit: 128000 kB
Last updated
Problem Statement :
Given a number, you need to check whether any permutation of the number is divisible by 8 or not. Print Yes or No. The problem was asked by Google and Citrix. Note: A Permutation of a number is a number that is made by rearranging the digits of a given number. Input The first input line contains a single integer T denoting the number of test cases. Then T test cases follow. Each test case consists of one line. The first line of each test case consists of a number of length N.
Constraints 1 ≤ T ≤ 100 1 ≤ N ≤ 100000 Output Corresponding to each test case, in a new line, print Yes if divisible by 8, else No. Example Input 2 46 345
Output Yes No
Explanation:- Testcase1:- 64 is divisible by 8
link: