import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner=new Scanner(System.in); float h=scanner.nextFloat(); int n =scanner.nextInt(); //write your code here...... float sum = 0; float git = h; for (int i = 1; i <= n; i++){ sum += 2 * h; h = h / 2; } sum -= git; System.out.println(String.format("%.3f", h)+" "+String.format("%.3f", sum)); //输出格式为:System.out.println(String.format("%.3f", h)+" "+String.format("%.3f", sum)); } }