CodeForces 630G:Challenge Pennants【排列组合】

Challenge Pennants
Time Limit:500MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u

Description

Because of budget cuts one IT company established new non-financial reward system instead of bonuses.

Two kinds of actions are rewarded: fixing critical bugs and suggesting new interesting features. A man who fixed a critical bug gets "I fixed a critical bug" pennant on his table. A man who suggested a new interesting feature gets "I suggested a new feature" pennant on his table.

Because of the limited budget of the new reward system only 5 "I fixed a critical bug" pennants and 3 "I suggested a new feature" pennants were bought.

In order to use these pennants for a long time they were made challenge ones. When a man fixes a new critical bug one of the earlier awarded "I fixed a critical bug" pennants is passed on to his table. When a man suggests a new interesting feature one of the earlier awarded "I suggested a new feature" pennants is passed on to his table.

One man can have several pennants of one type and of course he can have pennants of both types on his table. There are n tables in the IT company. Find the number of ways to place the pennants on these tables given that each pennant is situated on one of the tables and each table is big enough to contain any number of pennants.

Input

The only line of the input contains one integer n (1 ≤ n ≤ 500) — the number of tables in the IT company.

Output

Output one integer — the amount of ways to place the pennants on n tables.

Sample Input

Input
2
Output
24
所有的旗子都要用上,好吧,是我想多了~~~
AC-code:
#include<cstdio>
#include<cmath>
long long C(long long n,int x)
{
	long long temp=1;
	for(int i=1;i<=x;i++)
		temp=temp*(n-i+1)/i; 
	return temp;
}
int main()
{
	int n;
	long long a,b;
	scanf("%d",&n);
	a=C(n,5)+4*C(n,4)+6*C(n,3)+4*C(n,2)+C(n,1);
	b=C(n,3)+2*C(n,2)+C(n,1);
	printf("%lld\n",a*b);
	return 0;
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值