import java.util.Scanner;
public class ZiYouLuoTi {
public static void main(String[] args){
Scanner stdin = new Scanner(System.in);
int height = 0;//自由落体的高度
int numbers = 0;//反弹的次数,也是落地的次数
float totalHeight = 0;//一共经历的距离
try{
height = stdin.nextInt();
numbers = stdin.nextInt();
}catch(Exception ex){
ex.printStackTrace();
}
System.out.println("第"+numbers+"次反弹的高度为:"+new ZiYouLuoTi().getDividend(height, numbers));
//计算第m次落地时,共经历的距离
if(numbers==1){
totalHeight = height;
}else{
totalHeight = height;
for(int i=1;i<numbers;i++){
totalHeight+=2*new ZiYouLuoTi().getDividend(height, i);
}
}
System.out.println("第"+numbers+"次落地时,共经历:"+totalHeight);
}
/**
* 根据反弹的次数计算反弹的高度
*/
public float getDividend(int height,int m){
float result = 1;
for(int i=0;i<m;i++){
result*=2;
}
return height/result;
}
}