#include <iostream>
#include <iomanip>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
int countA = n / k;
int sumA = (k + k * countA) * countA / 2;
int sumTotal = n * (n + 1) / 2;
int sumB = sumTotal - sumA;
int countB = n - countA;
cout << fixed << setprecision(1) << (double)sumA / countA << " " << fixed << setprecision(1) << (double)sumB / countB << endl;
return 0;
}