|시간 제한||메모리 제한||제출||정답||맞힌 사람||정답 비율|
|2 초||256 MB||6||5||5||83.333%|
Hank Morebooks is famous writer. He has already decided what his new book would be, but he has not come up with names for k of its characters. As for all his previous books, he would use the following way to generate names. He first creates a string of English letters, and then divides it to k different non-empty parts. Help Hank to find out if it is possible to divide the given string into k different names.
Input data contains several test cases. The first line of the input data contains the number of test cases t (1 ≤ t ≤ 1000).
Each test is described with two lines: the first line is the string to be divided, its length is at most 100. It contains only lowercase English letters. The second line contains integer k (1 ≤ k ≤ 5) — the number of parts that the given string must be divided to.
Print answer for each test case as described below.
If it is possible to divide the given string into k different non-empty parts, print "YES" as the first line of output. Then print k strings — the parts. Concatenated in order of output parts must form the input string.
If it is impossible to divide the given string as required, output "NO" for this test case.
3 aaa 2 aaa 3 abc 3
YES a aa NO YES a b c