#K35487. Can Prepare Signature Dish?
Can Prepare Signature Dish?
Can Prepare Signature Dish?
In this problem, you are given a series of test cases. For each test case, you are provided with a list of ingredients available in the kitchen and a list of special ingredients required to prepare a signature dish. Your task is to determine whether the dish can be prepared, i.e. whether all the required special ingredients are present among the kitchen ingredients.
Formally, for each test case, you are given two integers (N) and (M): the number of ingredients in the kitchen and the number of special ingredients respectively. Then you are given a list of (N) strings representing the kitchen ingredients, followed by a list of (M) strings representing the special ingredients. The dish can be prepared if and only if (S \subseteq K), where (S) is the set of special ingredients and (K) is the set of kitchen ingredients.
For each test case, output "YES" if the dish can be prepared, or "NO" otherwise. The output is case-insensitive.
inputFormat
The first line of input contains a single integer (T) (the number of test cases). The following lines describe each test case in the following format:
- The first line of each test case contains two space-separated integers (N) and (M).
- The second line contains (N) space-separated strings, each representing an ingredient available in the kitchen.
- The third line contains (M) space-separated strings, each representing a required special ingredient.
Note: If (M = 0), the third line may be empty, and in such cases, the dish can always be prepared.
outputFormat
For each test case, output a single line containing either "YES" or "NO". Output "YES" if all the required special ingredients are available in the kitchen, and "NO" otherwise.## sample
2
5 3
sugar flour eggs butter milk
flour eggs milk
4 2
potato tomato onion garlic
onion garlic
YES
YES
</p>