算法:乱搞法😅
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int main()
{
int n , k , p , x , y;
cin >> n >> k >> p >> x >> y;
if(!k)
{
if(x < y || p < y) puts("-1");
else cout << y << endl;
return 0;
}
vector<int> arr(k);
int s = 0;
for(auto &a : arr) cin >> a , s += a;
sort(arr.begin() , arr.end());
int idx = -1;
for(int i = 0 ; i < k ; i++)
if(arr[i] > y) break;
else
{
idx = i;
if(arr[i] == y) break;
}
if(idx > n / 2) puts("-1");
else
{
int a = n / 2 - idx , b = n / 2 - k + idx;
if(arr[idx] != y) a-- , b++;
s += a + b * y;
if(s > x) puts("-1");
else
{
if(y == 1)
for(int i = 0 ; i < a + b ; i++) cout << 1 << ' ';
else
{
for(int i = 0 ; i < a ; i++) cout << 1 << ' ';
for(int i = 0 ; i < b ; i++) cout << y << ' ';
}
}
}
}