Pro.ID10213 TitlePostal Vans Title链接http://10.20.2.8/oj/exercise/problem?problem_id=10213 AC2 Submit6 Ratio33.33% 时间&空间限制描述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 作者 |