100% Guaranteed Results


Project
$ 24.99
Category:

Description

5/5 – (1 vote)

This problem is a programming version of Problem 53 from projecteuler.net
There are exactly ten ways of selecting three from five, 12345:
123,124,125,134,135,145,234,235,245, and 345
5
In combinatorics, we use the notation, C3 = 10
In general,
n!
n
Cr = , where r ≤ n,n! = n × n − 1 × n − 2 × ⋯3 × 2 × 1 and 0! = 1 r! × (n − r)!
It is not until n = 23, that a value exceeds one-million:
23
C10 = 1144066
How many, not necessarily distinct, values of nCr, for 1 ≤ n ≤ N, are greater than K?
Input Format
Input contains two integers N and K.
Output Format
Print the answer corresponding to the test case.
Constraints
2 ≤ N ≤ 1000
18
1 ≤ K ≤ 10
Sample Input

Sample Output

Reviews

There are no reviews yet.

Be the first to review “Project”

Your email address will not be published. Required fields are marked *

Related products