-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2023.cpp
More file actions
37 lines (32 loc) · 962 Bytes
/
2023.cpp
File metadata and controls
37 lines (32 loc) · 962 Bytes
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
// we have a sequence a, whose product was 2023
// k numbers are removed and we now have a sequence B on length n
// from b find a and the elements removed from it
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll testcases;
cin >> testcases;
vector<ll> factors = {1, 7, 17, 119, 289, 2023};
for (ll testcase = 0; testcase < testcases; testcase++){
ll sized, removed;
cin >> sized >> removed;
vector<ll> a(sized);
ll current_product = 1;
for (ll i = 0; i < sized; i++){
cin >> a[i];
current_product *= a[i];
}
if(2023 % current_product == 0){
cout << "YES" << endl;
cout << 2023 / current_product << " ";
for (ll i = 0; i < removed - 1; i++){
cout << 1 << " ";
}
cout << endl;
}
else{
cout << "NO" << endl;
}
}
}