Good Bye 2023 1916A - 2023 Solution
Problem Link : https://codeforces.com/contest/1916/problem/A
Solution in C++:
- /// Author : AH_Tonmoy
- #include <bits/stdc++.h>
- using namespace std;
- int32_t main() {
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- int t;
- cin >> t;
- while (t--) {
- int n , k ; cin >> n >> k;
- int a ;
- long long x = 1 ;
- for ( int i = 0 ; i < n ; i++){
- cin >> a ;
- x *= a ;
- }
- if ( 2023 % x !=0){
- cout <<"No\n" ;
- }
- else{
- cout <<"YES\n";
- cout << 2023/x <<" ";
- for (int i = 1 ; i < k ; i++){
- cout <<"1 ";
- }
- cout <<endl;
- }
- }
- return 0 ;
- }
No comments