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