Pro.ID22044 TitleSwimming Title链接http://10.20.2.8/oj/exercise/problem?problem_id=22044 AC25 Submit38 Ratio65.79% 时间&空间限制描述Alice is two years old and she likes swimming. Strange that she always from a corner to the counter in the way bellow ( that means Alice must swim to ghe other site and back, then go to the other site corner), as is shown in Figure 1. Figure 1 The pool and the way of swimming Now the problem comes to you is: what is the least distance Alice has to swim ? 输入There are several test cases, one line for each case. For each line, there are two number of positive integers of the width and height. Width and Height are between 1 and 10000, inclusively. Input is ended with Width = Height = 0. 输出Description Alice is two years old and she likes swimming. Strange that she always from a corner to the counter in the way bellow ( that means Alice must swim to ghe other site and back, then go to the other site corner), as is shown in Figure 1. Figure 1 The pool and the way of swimming Now the problem comes to you is: what is the least distance Alice has to swim ? Input There are several test cases, one line for each case. For each line, there are two number of positive integers of the width and height. Width and Height are between 1 and 10000, inclusively. Input is ended with Width = Height = 0. Output Output each least distance in a single line, round the result to the nearest integer, e.g. 1.3 rounds to 1, 1.8 rounds to 2, 123.456 rounds to 123, 123.5 rounds to 124, 124.5 rounds to 125. Sample Input 1 1 Sample Output 3 样例输入1 1 样例输出3 提示作者 |