#include<bits/stdc++.h>
using namespace std;
signed main() {
int n, k, A = 0, B = 0, cA = 0, cB = 0;
cin >> n >> k;
for (int i = 1; i <= n; i++) {
if (i % k) B += i, cB++;
else A += i, cA++;
}
printf("%.1f %.1f", 1.0 * A / cA, 1.0 * B / cB);
return 0;
}