-
Notifications
You must be signed in to change notification settings - Fork 0
/
2023
47 lines (42 loc) · 1.13 KB
/
2023
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define pb push_back
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define dbg(x) cout << #x << " = " << x << "\n";
#define all(x) (x).begin(),(x).end()
#define ff first
#define ss second
#define srt(s) sort(all(s))
#define S size()
#define f(i,m,n) for(ll i=m;i<n;i++)
#define nf(i,b,a); for(ll i=(b);i>=(a);i--)
#define llv(a,n) vector<ll> a(n,0); for(ll i=0;i<n;i++) cin>>a[i];
#define test(v) for(auto i:v) cout<<i<<' '; cout<<endl;
//think again
void solve(){
ll a,b; cin>>a>>b; llv(v,a);
f(i,0,a){
if(v[i]>289 and v[i]!=2023){
cout<<"NO"<<endl; return;
}
}
ll cnt=1; f(i,0,a)cnt*=v[i];
if(2023%cnt!=0){
cout<<"NO"<<endl; return;
}else{
cout<<"YES"<<endl; f(i,0,b-1)cout<<1<<" "; cout<<2023/cnt<<endl; return;
}
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
ll t;cin>>t;
while(t--)
solve();
return 0;
}