#include<iostream>
using namespace std;
int main(){
    double a,c,d,e,f,g,h,j;
    int b;
    cin>>a>>b;
    for(int i=1;i<=a;i++){
        if(i%b==0){
            c+=i;
            e+=1;
        }
        else{
            d+=i;
            f+=1;
        }
    }
    g=c/e;
    h=d/f;
    printf("%.1f",g);
    cout<<" ";
    printf("%.1f",h);
}

0 comments

No comments so far...