#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c1;
cin>>a>>b;
float c=0,d=0;
for(int i=1;i<=a;i++){
if(i%b==0){
c+=i;
c1++;
}else if(i%b!=0){
d+=i;
}
}
cout<<fixed<<setprecision(1)<<(float)c/c1<<" ";
cout<<fixed<<setprecision(1)<<(float)d/(a-c1);
return 0;
}