CF630H.Benches

普及/提高-

通过率:0%

时间限制:0.50s

内存限制:64MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

The city park of IT City contains n east to west paths and n north to south paths. Each east to west path crosses each north to south path, so there are _n_2 intersections.

The city funded purchase of five benches. To make it seems that there are many benches it was decided to place them on as many paths as possible. Obviously this requirement is satisfied by the following scheme: each bench is placed on a cross of paths and each path contains not more than one bench.

Help the park administration count the number of ways to place the benches.

IT 城市的市立公园包含 nn 条自西向东的道路和 nn 条自南向北的道路。每条自西向东的道路都与每条自南向北的道路相交,因此共有 n2n^2 个交叉口。

市政府出资购置了五张长椅。为了营造“长椅数量众多”的视觉效果,决定将这些长椅尽可能多地放置在不同的道路上。显然,以下方案满足该要求:每张长椅均放置在一个道路交叉口上,且每条道路至多放置一张长椅。

请帮助公园管理部门计算放置这五张长椅的方案数。

输入格式

The only line of the input contains one integer n (5 ≤ n ≤ 100) — the number of east to west paths and north to south paths.

输入仅包含一行,其中有一个整数 nn(5 ≤ n ≤ 1005 \leq n \leq 100)——表示自东向西和自北向南的道路数量。

输出格式

Output one integer — the number of ways to place the benches.

输出一个整数——放置长椅的方法数。

输入输出样例

  • 输入#1

    5

    输出#1

    120

输入解题思路,AI测评打分。不知道怎么写?

首页