View Code of Problem 72

#include<stdio.h>
int main()
{
	
	int m,n;
	scanf("%d%d",&m,&n);
	double h=m;
	double sum=m;
	while(n>1)
	{
		h=h/2;
		sum+=(2*h);
		n--;
	}
	printf("%.2lf %.2lf\n",h/2,sum);

	
	return 0;
}

Double click to view unformatted code.


Back to problem 72