10213_PostalVans

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

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

Pro.ID

10213

Title

Postal Vans

Title链接

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

AC

2

Submit

6

Ratio

33.33%

时间&空间限制

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

    Tiring of their idyllic fields, the cows have moved to a new suburb. The suburb is a rectangular grid of streets with a post office at its Northwest corner. It has four avenues running East-West and N (1 ≤ N ≤ 1000) streets running North-South.

    For example, the following diagram shows such a suburb with N=5 streets, with the avenues depicted as horizontal lines, and the post office as a dark blob at the top-left corner:

    Each day the postal van leaves the post office, drives around the suburb and returns to the post office, passing exactly once through every intersection (including those on borders or corners). The executives from the post company want to know how many distinct routes can be established for the postal van (of course, the route direction is significant in this count).

    For example, the following diagrams show two such routes for the above suburb:

    As another example, the following diagrams show all the four possible routes for a suburb with N=3 streets:

    Write a program that will determine the number of such distinct routes given the number of streets.

    输入

    Multiple test cases. Each case is a single integer, N , in one line.

    输出

    Description

    Tiring of their idyllic fields, the cows have moved to a new suburb. The suburb is a rectangular grid of streets with a post office at its Northwest corner. It has four avenues running East-West and N (1 ≤ N ≤ 1000) streets running North-South.

    For example, the following diagram shows such a suburb with N=5 streets, with the avenues depicted as horizontal lines, and the post office as a dark blob at the top-left corner:

    Each day the postal van leaves the post office, drives around the suburb and returns to the post office, passing exactly once through every intersection (including those on borders or corners). The executives from the post company want to know how many distinct routes can be established for the postal van (of course, the route direction is significant in this count).

    For example, the following diagrams show two such routes for the above suburb:

    As another example, the following diagrams show all the four possible routes for a suburb with N=3 streets:

    Write a program that will determine the number of such distinct routes given the number of streets.

    Input

    Multiple test cases. Each case is a single integer, N , in one line.

    Output

    For each case, output a single integer that tells how many possible distinct routes corresponding to the number of streets given in the input.

    Sample Input

    4

    Sample Output

    12

    Source

    样例输入

    4

    样例输出

    12

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部