#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<queue>
#define INF 0x3f3f3f
#define N 7000007
using namespace std;
inline int read() {
int x=0,f=1; char ch=getchar();
while(ch<'0' || ch>'9') { if(ch=='-') f=-1; ch=getchar(); }
while(ch>='0'&&ch<='9') { x=(x<<3)+(x<<1)+(ch^48); ch=getchar(); }
return x * f;
}
int n,m,q,u,v,t,ofst; //offsetÆ«ÒÆÁ¿
int h=1,h1=1,h2=1,t1,t2; //t1£¬t2²ÅÊÇÊý×é´óС£¬h1£¬h2ÊÇ¿ÉÓÃ×î´óÖµ
int s[N],c1[N],c2[N]; //ÔÊý×飬cut1£¬cut2
priority_queue<int> pq;
bool cmp(int a,int b) {
return a > b;
}
int main()
{
n = read(), m = read(), q = read(), u = read() ,v = read() ,t = read();
double p = (double)u / (double)v;
for(int i=1;i<=n;++i)
s[i] = read();
sort(s+1, s+1+n, cmp);
for(int i=1;i<=m;++i) {
int tp,a1,a2;
if(h > n) c1[h1]>c2[h2] ? tp=c1[h1++] : tp=c2[h2++];
else if(s[h]>=c1[h1] && s[h]>=c2[h2]) tp = s[h++]; //
else if(c1[h1]>=s[h] && c1[h1]>=c2[h2]) tp = c1[h1++];
else tp = c2[h2++];
tp += ofst; a1 = floor(p*(double)tp); a2 = tp - a1;
ofst += q; a1 -= ofst; a2 -= ofst;
c1[++t1] = a1, c2[++t2] = a2;
if(i % t==0) printf("%d ",tp);
}
putchar('\n');
for(int i=h;i<=n;++i) pq.push(s[i]);
for(int i=h1;i<=t1;++i) pq.push(c1[i]);
for(int i=h2;i<=t2;++i) pq.push(c2[i]);
int i = 0;
while(!pq.empty()) {
++i; if(i%t==0) printf("%d ",pq.top()+ofst); pq.pop();
}
return 0;
}
蛐蛐国最近蚯蚓成灾了!
最新推荐文章于 2025-05-23 08:55:07 发布