Codeforces 131C C (combination)

Source: Internet
Author: User

There is 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 le SS than 4 boys and no less than one girl. How many ways is there to choose a group? Of course, the variants that is only differ in the composition of the troupe is considered different.

Perform all calculations in the 64-bit type: a 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≤ tn + m).

Output

Find the required number of ways.

%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 Individuals, boys more than four, girls more than one, high school's permutation combination
1#include <iostream>2#include <cstdio>3#include <cmath>4typedefLong Longll;5 using namespacestd;6 ll Fun (ll A, ll b)7 {8ll temp=1;9      for(intj=1;j<=b; J + +)Ten     { Onetemp=temp*a/J; Aa--; -     } -     returntemp; the } - intMain () - { - ll M,n,t; +     inti,j; -Cin>>m>>n>>T; +ll sum=0; A      for(i=4; i<t&&i<=m;i++) at     { -         if(t-i>=1&&t-i<=t-4&&t-i<=N) -Sum=sum+fun (m,i) *fun (n,t-i); -     } -cout<<sum<<Endl; -     return 0; in}

Codeforces 131C C (combination)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.