LCC/Moose '19 Contest 3 J5 - Pesky Pascallions

View as PDF

Submit solution

Points: 7 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem types

Find the X_{th} number, indexed from 0, in the N_{th} row of Pascal's Triangle.

Below are the first few rows of pascal's triangle:

    1        0th Row
   1 1       1st Row
  1 2 1      2nd Row
 1 3 3 1     3rd Row
1 4 6 4 1    4th Row

Each number is created by adding the two numbers directly above it.

Input Specification

The first line will contain the numbers N (0 \le N \le 10^6) and X (0 \le X \le N) separated by a space.

Output Specification

On the first line, output the X_{th} number of the N_{th} row of Pascal's triangle modulo the product of two primes 1000036000099.

Sample Input 1

4 2

Sample Output 1

6

Sample Explanation 1

The fourth row of Pascal's triangle is 1 4 6 4 1, and the number with the index 2 is 6.


Comments

There are no comments at the moment.