Files
contests/misc/tlbdhsg/b20.cpp

23 lines
312 B
C++

#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, x, k;
cin >> n >> k >> x;
cout << n + 1 << '\n';
k--;
while (n--) {
int a;
cin >> a;
cout << a << ' ';
k--;
if (!k)
cout << x << ' ';
}
cout << '\n';
}