#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main() {
// h米小球经过距离s和第n次反弹高度hf
double h,s,hf;
int n;
cin >> h;
cin >> n;
s = h;
hf = h/2;
// 第1次落地,h米;第n次落地,h+h/2*2+…+h/(pow(2,n-1))*2
if(n==1)
s = h;
if(n >= 1)
for(int i=2; i <= n; i++){
s = s + h/(pow(2,i-1))*2;
hf = hf/2;
//第n次反弹高度h/2(n-1)
}
cout <<setiosflags(ios::fixed) << setprecision(1) << s << " " << hf << endl;
return 0;
}

京公网安备 11010502036488号