78 - ZOJ Monthly, May 2009 - D
Let me introduce an easy game to you: give you n integers in a line you must put (n-1) operators ("+","-","*" ,"/") between any two adjacent integers to combine them into a number(In the given order). At last the result mustn't have the digit k (0<=k<=9). You must find the largest result number that doesn't have the digit k.
InputStandard input will contain multiple test cases. The first line of the input is a single integer T (1 <= T <= 200) which is the number of test cases. T consecutive test cases follow.
The first line of each test case is two numbers n and k (2<=n<=9,0<=k<=9). The second line of each test case is n nonnegative integers less than 100. Process to End Of File.
OutputFor each test case output the largest result number that doesn't cotain the digit k. If there is no such number, output "No result" instead.
2 3 5 1 2 5 2 1 11 10
10 No result
Author: CAO, Peng
Source: ZOJ Monthly, May 2009