CF1916A 2023

题目描述

求一个元素乘积为 $2023$ 的数组 $a$,其中的 $k$ 个元素被移除后得到数组 $b$。现在告诉你 $b$,问是否能找到一个满足以上条件的数组 $a$。

输入格式

多组测试,第一行一个整数 $t(1\le t\le 100)$——测试数据的数量,接下来描述一组数据的输入: - 第一行 $2$ 个整数 $n$,$k$,($1\le n,k\le 5$),分别表示 $b$ 的长度和 $a$ 中被移除元素的个数; - 接下来一行 $n$ 个整数,表示 $b$。

输出格式

对于每组数据,如果不存在一个满足要求的 $a$,输出 `NO`,否则输出 `YES`,并换行输出 $a$ 中被删除的 $k$ 个元素,大小写不敏感。

说明/提示

In third test case product is equal to $ 289 \cdot 7 = 2023 $ . In fourth test case product is already equal to $ 2023 $ . In seventh test case product is equal to $ 7 \cdot 17 \cdot 17 = 2023 $ .