一定要注意 n==k 不然会RE的
#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
const int maxn=1100;
int sorce[maxn],n,k,l,r,sall,sk;
int main()
{
cin>>n>>k>>l>>r>>sall>>sk;
for(int i=1;i<=k;i++)
{
sorce[i]=sk/k;
}
int t=sk%k,i=1;
while(t)
{
t--; sorce[i++]++;
}
if(k!=n)
{
for(int i=k+1;i<=n;i++)
{
sorce[i]=(sall-sk)/(n-k);
}
int t,i;
t=(sall-sk)%(n-k),i=k+1;
while(t)
{
t--; sorce[i++]++;
}
}
for(int i=1;i<=n;i++)
{
cout<<sorce[i]<<" ";
}
return 0;
}