#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,t=0,t1=0,s=0,s1=0;
double d,d1;
cin>>a>>b;
for(int i=1;i<=a;i++){
if(i%b==0){
t+=i;
s++;
}else{
t1+=i;
s1++;
}
}
d=t/s;
d1=t1/s1;
cout<<cout<<setprecision(1)<<std::fixed<<d<<" ";
cout<<cout<<setprecision(1)<<std::fixed<<d1;
return 0;
}