#include<stdio.h> int main(){ double m,h,l=0; int n; scanf("%lf%d",&m,&n); h=m; for(int i=0;i<n;i++){ h=h/2; l=l+h*3; } l=l-h; printf("%.2lf %.2lf",h,l); }
Double click to view unformatted code.