Description

One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the number of variants of group composition to evaluate.

Input

The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes.

Output

Output one integer — the number of different variants of group composition.

Examples
input
7
output
29
从n个人中选5,6,7个一共多少种选法
#include<stdio.h>
//#include<bits/stdc++.h>
#include<string.h>
#include<iostream>
#include<math.h>
#include<sstream>
#include<set>
#include<queue>
#include<map>
#include<vector>
#include<algorithm>
#include<limits.h>
#define inf 0x7fffffff
#define INF 0x7fffffffffffffff
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define LL long long
#define ULL unsigned long long
using namespace std;
LL n;
ULL C(int n,int m)
{
if(n<m) return 0;
ULL ans=1;
for(int i=0;i<m;i++) ans=ans*(ULL)(n-i)/(ULL)(i+1);
return ans;
}
ULL A(int n,int m)
{
if(n<m) return 0;
ULL ans=1;
for(int i=0;i<m;i++) ans*=(ULL)(n-i);
return ans;
}
int main()
{
cin>>n;
cout<<C(n,5)+C(n,6)+C(n,7)<<endl;
return 0;
}

  

Experimental Educational Round: VolBIT Formulas Blitz F的更多相关文章

  1. Experimental Educational Round: VolBIT Formulas Blitz

    cf的一次数学场... 递推 C 题意:长度<=n的数只含有7或8的个数 分析:每一位都有2种可能,累加不同长度的方案数就是总方案数 组合 G 题意:将5个苹果和3个梨放进n个不同的盒子里的方案 ...

  2. Experimental Educational Round: VolBIT Formulas Blitz K

    Description IT City company developing computer games decided to upgrade its way to reward its emplo ...

  3. Experimental Educational Round: VolBIT Formulas Blitz N

    Description The Department of economic development of IT City created a model of city development ti ...

  4. Experimental Educational Round: VolBIT Formulas Blitz J

    Description IT City company developing computer games invented a new way to reward its employees. Af ...

  5. Experimental Educational Round: VolBIT Formulas Blitz D

    Description After a probationary period in the game development company of IT City Petya was include ...

  6. Experimental Educational Round: VolBIT Formulas Blitz C

    Description The numbers of all offices in the new building of the Tax Office of IT City will have lu ...

  7. Experimental Educational Round: VolBIT Formulas Blitz B

    Description The city administration of IT City decided to fix up a symbol of scientific and technica ...

  8. Experimental Educational Round: VolBIT Formulas Blitz A

    Description The HR manager was disappointed again. The last applicant failed the interview the same ...

  9. Experimental Educational Round: VolBIT Formulas Blitz K. Indivisibility —— 容斥原理

    题目链接:http://codeforces.com/contest/630/problem/K K. Indivisibility time limit per test 0.5 seconds m ...

随机推荐

  1. sql 的积累

    sql的积累 By:山高似水深 原创 转载注明出处 .REVERSE() 反转 例如: Hive 可用 2016年12月3日11:31:59 2.instr(str,'.')位置 结果:得出在str中 ...

  2. Hive UDF开发 第一个例子

    package udf; import org.apache.hadoop.hive.ql.exec.UDF; public class helloudf extends UDF{ public St ...

  3. activity状态保存的bundl对象存放位置的思考

    我们知道,当activity被异常终止时,可以把一些信息保存到bundle对象中,在下次启动时恢复. 那么,这个bundle对象是保存在哪里的呢? 这种状态保存的方法针对的是activity而不是进程 ...

  4. 读书笔记<深入理解JVM>01 关于OutOfMemoryError 堆空间的溢出

    代码片段如下: package com.gosaint.shiro; import java.util.ArrayList; import java.util.List; public class H ...

  5. Codeforces 1077(F1+F2) DP 单调队列

    题意:给你一个n个元素的数组,从中选取x个元素,并且要保证任意的m个位置中必须至少有一个元素被选中,问选中元素的和最大可以是多少? F1 n,m,x到200 F2 n,m,x到5000. 思路1:设d ...

  6. C++实现筛选法

    筛选法 介绍: 筛选法又称筛法,是求不超过自然数N(N>1)的所有质数的一种方法.据说是古希腊的埃拉托斯特尼(Eratosthenes,约公元前274-194年)发明的,又称埃拉托斯特尼筛子. ...

  7. java Swing 练习

    import javax.swing.JFrame; public class Swingtest { static final int WIDTH = 500; static final int H ...

  8. Gearman 分布式的异步任务分发框架

    What is Gearman? Gearman provides a generic application framework to farm out work to other machines ...

  9. 什么是FastCGI, PHP-FPM

    CGI,FastCGI都是一套接口标准:是编程语言(比如php,python; python里面也有wsgi)与web服务器(比如Nginx)的通信标准(比如你跟老外交流,那么FastCGI就相当于是 ...

  10. 最新解决VS2017+ Mysql + EF 创建实体数据模型 闪退的办法

    研究下来,就是最新的版本兼容性不好啊. 1.找到MySql管网,下载历史版本: mysql-connector-net-6.9.12 mysql-for-visualstudio-1.2.8 2.Nu ...