#Lutece0611. An Easy Number Game
An Easy Number Game
Migrated from Lutece 611 An Easy Number Game
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
There are non-negative intergers (no greater than ) and a number , can you make a eight-digit number(without leading zeros) with these intergers with the additional condition that the eight-digit number should be divided by the number .
Input
The first line of the input contains a single integer (), the number of test cases, followed by the input data for each test case. The first line of each test case contains integers, while the second line contains the interger ().
Output
For each case, if you can form such a eight-digit number,output Yes
, otherwise,output No
.
Samples
2
1 2 3 4 5 6 7 8
12345678
1 2 3 4 5 6 7 8
12345677
Yes
No
Resources
6th BUPT Programming Contest Final