#include<iostream>
#include<iomanip>
using namespace std;
int main() {
int n, k, sum, num, count1, count2;
cin >> n;
cin >> k;
sum = 0;
num = 0;
count1 = 0;
count2 = 0;
for (int i = 1; i <= n; i++) {
if (i % k == 0) {
sum = sum + i;
count1 ++;
}
else if (i % k != 0) {
num = num + i;
count2 ++;
}
}
cout << fixed << setprecision(1) << double(sum / count1) << " " << fixed << setprecision(1) << double( num / count2 );
return 0;
}