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