/* * 题目分析: 递归思路 * 注意: 第5次落地时经历了多少米 和 第5次反弹多高 */ import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNextInt()) { double height = sc.nextDouble(); double total = height; for (int i = 0; i < 5; i++) { height = (double)((long)((height / 2) * 1000000)) / 1000000; total += height * 2; } total -= height * 2; System.out.println(total); System.out.println(height); } } }