题目简单易懂,不多说了,直接贴代码吧。
#include<stdio.h>
int n,k,l,r,Sall,Sk;int main()
{
int i;
scanf("%d%d%d%d%d%d", &n,&k,&l,&r,&Sall, &Sk);
Sall-=Sk;
for(i=k; i>0; --i)
{
printf("%d ", Sk/i);
Sk-=Sk/i;
}
for(i=n-k; i>0; --i)
{
printf("%d ", Sall/i);
Sall-=Sall/i;
}
printf("\n");
return 0;
}