-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathA_2023.cpp
120 lines (101 loc) · 2.37 KB
/
A_2023.cpp
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/**
* Bismillahir Rahmanir Rahim
* Author: Ashfak Hossain Evan, American International University, Bangladesh
* Created: 30/12/2023 23:17:51
**/
#include <bits/stdc++.h>
#ifdef BERLIN
#include "algo/debug.h"
#else
#define debug(...) 42
#endif
#define all(x) (x).begin(), (x).end()
#define sz(x) ((long long)x.size())
#define char2Int(c) (c - '0')
#define lastEle(vec) vec[vec.size() - 1]
#define PI 3.1415926535897932384626433832795l
#define endl '\n'
#define f first
#define s second
#define pb push_back
#define range(i, v) for (auto &i : v)
#define fix(prec) \
{ \
cout << setprecision(prec) << fixed; \
}
#define mem(arr, v) memset(arr, v, sizeof(arr))
#define getunique(v) \
{ \
sort(all(v)); \
v.erase(unique(all(v)), v.end()); \
}
#define Muichiro ios_base::sync_with_stdio(false);
#define Tokito cin.tie(NULL);
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
const int MAX_N = 1e5 + 5;
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
const ld EPS = 1e-9;
void Free_Palestine()
{
int n, k;
cin >> n >> k;
int yy[n + 10000];
int xx = 2023;
bool flag = true;
for (int i = 0; i < n; i++)
{
cin >> yy[i];
if (xx % yy[i] == 0)
{
xx /= yy[i];
}
else
flag = false;
}
if (flag)
{
cout << "YES" << endl;
for (int i = 0; i < k; i++)
{
if (i)
{
cout << 1 << " ";
}
else
{
cout << xx << " ";
}
}
cout << endl;
}
else
cout << "NO" << endl;
}
int main()
{
Muichiro Tokito
#ifdef BERLIN
clock_t tStart = clock();
freopen("input.txt", "r", stdin);
freopen("error.txt", "w", stderr);
freopen("output.txt", "w", stdout);
#endif
int _;
cin >> _;
while (_--)
Free_Palestine();
#ifdef BERLIN
fprintf(stderr, "\nRuntime: %.10fs\n", (double)(clock() - tStart) / CLOCKS_PER_SEC);
#endif
return 0;
}