View Code of Problem 72

#include<stdio.h>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
int main(){
       float m,n,sum,high;
       scanf("%f%f", &m, &n);
       sum=0;
       for(int i=0;i<n;i++){
       	  high=m;
       	   m=m/2.0;
       	   sum=sum+high+m;
	   }
	   printf("%.2f %.2f",m,sum-m);
	   	  return 0;
}

Double click to view unformatted code.


Back to problem 72