#include<stdio.h> int main() { int M,N,i; scanf("%d %d",&M,&N); double high=M,sum=M,temp=0; for(i=0;i<N;i++) { high/=2.0; sum+=2.0*temp; temp=high; } printf("%.2lf %.2lf",high,sum); return 0; }
Double click to view unformatted code.