#include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
scanf("%d%d", &n, &k);
int totalA = 0, countA = 0, totalB = 0, countB = 0;
for (int i = 1; i <= n; i++)
if (i % k == 0)
totalA += i, countA++;
else
totalB += i, countB++;
double a = (totalA * 1.0) / (countA * 1.0), b = (totalB * 1.0) / (countB * 1.0);
printf("%.1f %.1f\n", a, b);
return 0;
}
P5719(分类平均)
最新推荐文章于 2024-02-18 16:59:12 发布