22044_Swimming

2022-5-16 18:21| 发布者: Hocassian| 查看: 32| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-4-8950665319499-Problem List-采集的数据-后羿采集器.html

Pro.ID

22044

Title

Swimming

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22044

AC

25

Submit

38

Ratio

65.79%

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    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
    1 2
    2 1
    0 0

    Sample Output

    3
    6
    4

    样例输入

    1 1
    1 2
    2 1
    0 0

    样例输出

    3
    6
    4

    提示

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部