CodeForces 306A Candies(水题)
程序员文章站
2022-06-02 11:50:48
...
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
typedef long long ll;
const int maxn = 10010;
const int INF = 0x3f3f3f3f;
int a[maxn];
int main()
{
int n,m;
scanf("%d%d",&n,&m);
if(n%m==0)
{
for(int i=0;i<m;i++)
printf("%d ",n/m);
}
else
{
for(int i=0;i<m-n%m;i++)
printf("%d ",n/m);
for(int i=0;i<n%m;i++)
printf("%d ",n/m+1);
}
return 0;
}
推荐阅读
-
Codeforces 939A题,B题(水题)
-
B. Nastya Is Playing Computer Games---(水题模拟)Codeforces Round #546 (Div. 2)
-
Codeforces 939A题,B题(水题)
-
CodeForces 306A Candies(水题)
-
codeforces 1300A Non-zero 水题
-
codeforces 1294A Collecting Coins 水题
-
Codeforces 987B. High School: Become Human(1ni)(数学水题)
-
Codeforces 450B. Jzzhu and Sequences(1ni)(规律水题)