Nyoj 158 is coming

Source: Internet
Author: User
Time Limit: 1000 MS | memory limit: 65535 kb difficulty: 2
Description

The annual Henan Program Design Competition is coming again.

The competition requires a team. In the form of a team, three members form a team, with one captain and two players.

Now the problem is coming. For m people, ask n people in each team. There are several different teams.

(Ensure that M % N is equal to 0, and all data does not exceed the int range)

Input
Multiple groups of test data, ended with EOF.
Input two integers (m, n) for each group of test data.
Output
Output the number of different teams for each group of test data (considering that the number of outputs may be large, please output the value after the remainder of 2013 ), enter a line break after the output ends.
Sample Input
4 2
Sample output
6
Combination problem!
AC code:
#include<stdio.h>int C(int m,int n){int cm=1,cn=1,i;for(i=2;i<=n;i++)cn*=i;for(i=m-n+1;i<=m;i++)cm*=i;return cm/cn;}int main(){int m,n;while(~scanf("%d%d",&m,&n)){int res=1;while((m/n)>1){res=res*C(m,n)%2013;m-=n;}printf("%d\n",res);}return 0;}


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.