#include<bits/stdc++.h>
using namespace std;
int main()
{
float a=0,b=0;
int n,k,c=0,m=0;
cin>>n>>k;
for(int i=1;i<=n;i++)
{
if(i%k == 0)
{
a+=i;
c+=1;
}
else
{
b+=i;
m+=1;
}
}
float ap=a/c,bp=b/m;
cout<<fixed<<setprecision(1)<<ap;
cout<<" ";
cout<<fixed<<setprecision(1)<<bp;
}