There are n boys and m girls attending a theatre club. To set a play "The Big Bang Theory", they need to choose a group containing exactly t actors containing no less than 4 boys and no less than one girl. How many ways are there to choose a group? Of course, the variants that only differ in the composition of the troupe are considered different.

Perform all calculations in the 64-bit type: long long for С/С++, int64 for Delphi and long for Java.

Input

The only line of the input data contains three integers n, m, t (4 ≤ n ≤ 30, 1 ≤ m ≤ 30, 5 ≤ t ≤ n + m).

Output

Find the required number of ways.

Please do not use the %lld specificator to read or write 64-bit integers in С++. It is preferred to use cin, cout streams or the %I64d specificator.

Sample Input

Input
5 2 5
Output
10
Input
4 3 5
Output
3
n个人,男生大于四个,女生大于一个,高中的排列组合
 #include<iostream>
#include<cstdio>
#include<cmath>
typedef long long ll;
using namespace std;
ll fun(ll a, ll b)
{
ll temp=;
for(int j=;j<=b; j++)
{
temp=temp*a/j;
a--;
}
return temp;
}
int main()
{
ll m,n,t;
int i,j;
cin>>m>>n>>t;
ll sum=;
for(i=;i<t&&i<=m;i++)
{
if(t-i>=&&t-i<=t-&&t-i<=n)
sum=sum+fun(m,i)*fun(n,t-i);
}
cout<<sum<<endl;
return ;
}

CodeForces 131C C (组合)的更多相关文章

  1. Codeforces 131C . The World is a Theatre(打表组合数)

    题目链接:http://codeforces.com/contest/131/problem/C 大意就是有n个男孩,m个女孩,从男孩中选不少于4个男孩,女孩中选不少于1个女孩,组成人数为t的队伍,问 ...

  2. CodeForces 57C Array 组合计数+逆元

    题目链接: http://codeforces.com/problemset/problem/57/C 题意: 给你一个数n,表示有n个数的序列,每个数范围为[1,n],叫你求所有非降和非升序列的个数 ...

  3. codeforces 900D 数论+组合+容斥原理

    问有多少个这样的数字序列 所有数的GCD等于x 并且 所有数的和等于y 题解: 非常难有思路啊 看题解后过的. 考虑序列GCD为x的倍数 即GCD = n*x 和当然都为y 这个条件不要忘了 这样我们 ...

  4. codeforces 571A--Lengthening Sticks(组合+容斥)

    A. Lengthening Sticks time limit per test 1 second memory limit per test 256 megabytes input standar ...

  5. CodeForces - 131C The World is a Theatre(组合数)

    题意:已知有n个男生,m个女生.现在要选t个人,要求有至少4个男生,至少1个女生,求有多少种选法. 分析: 1.展开,将分子中的m!与分母中n!相约,即可推出函数C. #pragma comment( ...

  6. Codeforces Gym 100187D D. Holidays 排列组合

    D. Holidays Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/problem/D ...

  7. Codeforces Round #309 (Div. 2) C. Kyoya and Colored Balls 排列组合

    C. Kyoya and Colored Balls Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contes ...

  8. Codeforces Round #490 (Div. 3) :F. Cards and Joy(组合背包)

    题目连接:http://codeforces.com/contest/999/problem/F 解题心得: 题意说的很复杂,就是n个人玩游戏,每个人可以得到k张卡片,每个卡片上有一个数字,每个人有一 ...

  9. 【组合 数学】codeforces C. Do you want a date?

    codeforces.com/contest/810/problem/C [题意] 给定一个集合A,求 , 输入: [思路] 基数为n的集合有2^n-1个非空子集. 首先n个数要从小到大排序,枚举最后 ...

随机推荐

  1. JQuery 动态创建表单,并自动提交

    前言:写这个是为了实现使用cookie进行自动登录的功能, 下面的代码是一个元素一个元素进行创建和赋值的, (可以尝试下将所有的html代码(form.input)全部拼好以后放到${ } 中,再进行 ...

  2. checked、disabled在原生、jquery、vue下不同写法

          以下是原生和jquery <!DOCTYPE html> <html> <head> <meta http-equiv="Content ...

  3. 出现“ORA-28000:the account is locked”的解决办法

    在Oracle 11g版本中,出于安全的考虑,所有Oracle的默认用户,包括SCOTT用户都被锁定.输入用户名和口令之后,会出现错误“ORA-28000:the account is locked” ...

  4. AO如何获取SDE数据库中的数据

    /// <summary> /// 获取Table类型表的记录 /// </summary> /// <param name="relationCheckCla ...

  5. JavaOO知识点小结一

    Java语言的特点是什么?简单 面向对象 跨平台 多线程 健壮性安全性 垃圾回收机制如何编译和执行java文件?产生帮助文档用什么命令?编译: javac 文件名执行: java 类名产生帮助文档 j ...

  6. token session cookie

    token 登录握手与身份验证: cookie.session 记录会话状态 兼有 token的功能: cookie session 功能更强大. 所有这些都是为了便捷和密码安全考虑.

  7. Git及Github环境搭建(Windows系统)

    一.github账号注册 1.打开网址https://github.com  注册账号: 二.本地安装Git 1.安装包下载地址:链接:https://pan.baidu.com/s/1smpnJL7 ...

  8. Idea中修改servlet模板

    1.点击左上角的File: Setting --> Editor --> File and Code Templates --> Other --> web -->Ser ...

  9. python学习笔记之小小购物车

    #coding=utf-8 ''' Created on 2015-6-18 @author: 悦文 ''' def goods_list(): shangpin={"} print &qu ...

  10. 上传菜品数据&生成点餐二维码

    基础数据上传 在门店助手打开数据上传功能,点击上传到微餐厅3.0,,即将门店本地的基础数据上传到线上. 注意1:上传前,需要在线下系统维护好基础数据 注意2:线下基础数据发生更改时,需要手动在门店助手 ...