[BOJ 7791] KBTU party

View as PDF

Submit solution

Points: 4
Time limit: 2.0s
Memory limit: 128M

Problem types
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

At the latest KBTU ”Commencement” party Bakhytzhan noticed that there were n girls D1,D2,...,Dn and 2n−1 boys B1,B2,...,B2n−1. And every girl Dj knows exactly boys B1,B2,...,B2j−1. Throughout the evening party Bakhytzhan tried to count the number of possible choices of exactly r acquainted boys and girls pairs for dancing. That’s why he missed his chance for dancing. Please, write a program that would help Bakhytzhan don’t miss a chance to dance at the next party.

입력 형식

The input file contains two integer numbers n and r (1 ≤ n,r ≤ 106) separated by a space.

출력 형식

Output file should contain answer to Bakhytzhan’s problem – residue modulo 2946859

예제 입력

3 2

예제 출력

18

Comments

There are no comments at the moment.