CF1916A.2023
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
In a sequence a , whose product was equal to 2023 , k numbers were removed, leaving a sequence b of length n . Given the resulting sequence b , find any suitable sequence a and output which k elements were removed from it, or state that such a sequence could not have existed.
Notice that you are not guaranteed that such array exists.
输入格式
Each test consists of several test cases. The first line contains a single integer t ( 1≤t≤100 ) — the number of test cases. This is followed by a description of the test cases.
The first line of each test case contains two integers n ( 1≤n,k≤5 ) — the size of sequence b and the number of numbers removed from sequence a .
The second line contains n integers b1,b2,…,bn ( 1≤bi≤2023 ) — the remaining sequence. The values of bi might not be divisors of 2023 .
输出格式
For each test case, output "YES" if the sequence a exists, and in the following line output k non-negative integers that were removed from the sequence a . If the sequence a does not exist, output "NO" in a single line.
You can output the answer in any case (uppercase or lowercase). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive answers.
输入输出样例
输入#1
7 2 2 5 2 3 1 7 17 7 4 2 1 289 1 1 3 1 7 17 17 1 1 289 1 1 2023 1 3 1
输出#1
NO NO YES 7 1 YES 1 YES 7 YES 1 YES 7 17 17
说明/提示
In third test case product is equal to 289⋅7=2023 .
In fourth test case product is already equal to 2023 .
In seventh test case product is equal to 7⋅17⋅17=2023 .