Files
python/LuoGu/RuMen/P1887.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

14 lines
347 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <bits/stdc++.h>
using namespace std;
int a,b,i;
int main()
{
scanf("%d%d",&a,&b);
for (i=1;i<=b-a%b;++i) printf("%d ",a/b);
//为使乘积最大各个数字之差不超过1
//输出b-S%b个a/B
for (;i<=b;++i) printf("%d ",a/b+1);
//把余数尽可能平均分配给各个数输出a%b个a/B+1
}