#include<bits/stdc++.h> using namespace std; int main() { int Asum=0,Bsum=0,n,k; cin>>n>>k; for(int i=k;i<=n;i+=k){ Asum+=i; } Bsum=(n+1)*n/2-Asum; printf("%.1lf",double(Asum)/(n/k)); printf("%.1lf",double(Bsum)/(n-n/k)); return 0; }