H -
Benches

Crawling in process...
Crawling failed
Time Limit:500MS    
Memory Limit:65536KB     64bit IO Format:%I64d & %I64u

Description

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
n2 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.

Input

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.

Output

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

Sample Input

Input
5
Output
120
远看还以为是阶乘,--||然而n可以到一百,看了题才知道是组合数,东西向,南北向的路各n条,相互垂直的两条路一定会相交,形成了n*n个路口,现在5张长凳,
把凳子放到路口,并且每条路只能出现一张凳子,那摩我们就要从南北向,东西向的路中各挑出5条,然后,,,,,,
#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
__int64 C(__int64 m,__int64 n)
{
__int64 ans=1;
__int64 num=1;
while(n--)
{
ans*=(m-n);
ans/=num;
num++;
}
return ans;
}
int main()
{
__int64 n;
while(cin>>n)
{
cout<<120*C(n,5)*C(n,5)<<endl;
}
return 0;
}

最新文章

  1. IPC--&gt;PIPO
  2. JAVA 设计模式 代理模式
  3. [No00001C]不想背单词患者的福音!-快来定制你的个性词包-不想记、记不牢,这可怎么办?
  4. MySQL 使用SELECT ... FOR UPDATE 做事务写入前的确认(转)
  5. 使用eclipse开发servlet
  6. 软件测试工作中涉及的Linux命令整理
  7. perl 语法速查
  8. 多线程编程之Linux环境下的多线程(二)
  9. [terry笔记]更改oracle用户名
  10. 各大公司广泛使用的在线学习算法FTRL详解
  11. 《零成本实现Web自动化测试--基于Selenium》 第五章 Selenium-RC
  12. 【原】SparkContex源码解读(一)
  13. Linux通过使用Sambaserver示例
  14. Python day 6(5) Python 函数式编程3
  15. JSP转译成Servlet详细过程【转】
  16. .net 工程中引用出现感叹号
  17. ubuntu安装mysql没有让我设置密码
  18. MySQL之单表查询
  19. 解决“Can&#39;t bind to local 8630 for debugger”错误--查杀多余进程
  20. systemctl管理系统配置、服务

热门文章

  1. Element type &quot;LinearLayout&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;的解决办法
  2. html——meta标签、link标签
  3. [Windows Server 2008] 查看PHP详细错误信息
  4. oracle 用户的操作
  5. tac
  6. ionic错误
  7. zabbix实现163邮件报警
  8. demo__webpack
  9. 爬虫文件存储-3:Redis
  10. 为什么有些图像在显示前要除以255?(zhuan)