Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #include <ext/pb_ds/assoc_container.hpp>
  3. #include <ext/pb_ds/tree_policy.hpp>
  4. #define int int64_t
  5. #define F first
  6. #define S second
  7. //#define endl '\n'
  8.  
  9. using namespace std;
  10. using namespace __gnu_pbds;
  11. const int N = 3e5+5;
  12. const int INF = 1e18+7;
  13. const int MOD = 1e9+7;
  14. typedef tree<int, null_type, less<int>,rb_tree_tag,tree_order_statistics_node_update> SET; // *find_by_order(), order_of_key()
  15.  
  16. int32_t main()
  17. {
  18. ios_base::sync_with_stdio(false);
  19. cin.tie(0); cout.tie(0);
  20. // freopen("input.txt","r",stdin);
  21. // freopen("output.txt","w",stdout);
  22. // clock_t StartTime = clock();
  23. // cout<<"Time = "<<(long double)(clock()-StartTime)/CLOCKS_PER_SEC;
  24. int n,k,p,x,y,sum=0;
  25. cin>>n>>k>>p>>x>>y;
  26. vector<int> v(k);
  27. for(int i=0;i<k;i++) cin>>v[i];
  28. int t1=n/2,t2=n/2;
  29. sum+=y;
  30. for(int i=0;i<k;i++){
  31. if(v[i]==y){
  32. if(t2>0) t2--;
  33. else t1--;
  34. sum+=v[i];
  35. continue;
  36. }
  37. if(v[i]>y) t2--;
  38. else t1--;
  39. sum+=v[i];
  40. }
  41. vector<int> ans;
  42. cout<<t1<<" "<<t2<<endl;
  43. sum+=t1;
  44. for(int i=0;i<t1;i++){
  45. ans.push_back(1);
  46. }
  47. sum+=t2*y;
  48. for(int i=0;i<t2;i++){
  49. ans.push_back(y);
  50. }
  51. ans.push_back(y);
  52. if(sum<=x){
  53. for(int x : ans) cout<<x<<endl;
  54. }else{
  55. cout<<-1<<endl;
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement