Skip to content

Commit 517c869

Browse files
committed
Problem B also added
1 parent b28986b commit 517c869

File tree

1 file changed

+47
-0
lines changed
  • Codeforces_Contests/Round_638_Div_2

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/**************************************************************************
2+
* $Id$
3+
* File:
4+
*
5+
* Purpose:
6+
*
7+
* Author: Sanchit Gupta (CS19B071)
8+
*
9+
* Created:
10+
*
11+
* Last modified:
12+
*
13+
* Bugs:
14+
*
15+
* Change Log:
16+
*
17+
* While(!(succeed==try());
18+
**************************************************************************/
19+
#include <bits/stdc++.h>
20+
using namespace std;
21+
22+
int main(){
23+
int t; cin>>t;
24+
while (t--)
25+
{
26+
int n,k;
27+
cin>>n,k;
28+
set<int>s;
29+
for (int i=0;i<n;i++){
30+
int a;
31+
cin>>a;
32+
s.insert(a);
33+
}
34+
if (s.size()>k){
35+
cout<<-1<<endl;
36+
return;
37+
}
38+
cout<<n*k<<endl;
39+
for (int i=0;i<N;i++){
40+
for (int b:s)
41+
cout<<b<<' ';
42+
for (int j=0;j<k-(int)s.size();j++)
43+
cout<<1<<' ';
44+
}
45+
cout<<endl;
46+
}
47+
}

0 commit comments

Comments
 (0)