#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k,s=0,m=0;
int a=0,b=0;
cin>>n>>k;
for(int i=1;i<=n;i++)
{
if(i%k==0)
{
s+=i;
a++;
}
else if(i%k!=0)
{
m+=i;
b++;
}
}
if(k==0)
{
cout<<0.0<<" "<<0.0;
}
if(a==0)
{
cout<<0.0<<" "<<setprecision(1)<<fixed<<(double)(m/b)<<endl;
}
if(b==0)
{
cout<<setprecision(1)<<fixed<<(double)(s/a)<<" "<<0.0<<endl;
}
cout<<setprecision(1)<<fixed<<(double)(s/a)<<" "<<(double)(m/b)<<endl;
return 0;
}