You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
324 B
14 lines
324 B
2 years ago
|
#include <bits/stdc++.h>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
int main() {
|
||
|
int n, k;
|
||
|
int Asum = 0, Bsum;
|
||
|
cin >> n >> k;
|
||
|
for (int i = k; i <= n; i += k) Asum += i;
|
||
|
Bsum = (1 + n) * n / 2 - Asum;
|
||
|
printf("%.1lf ", double(Asum) / (n / k));
|
||
|
printf("%.1lf ", double(Bsum) / (n - n / k));
|
||
|
return 0;
|
||
|
}
|