Problem Code CN02 Difficulty  Simple Prerequisites: Modular Multiplicative Inverse Mathematics(Permutations and Combinations) Euler's Theorem or Extended Euclidean algorithm Problem: Find the number of integral solutions of the equation 2(a1+a2+a3+a4+a5+a6)+a7=N . a7 can take values from 1 to N12. Now iterate over all the values of a7 and find the number of solutions, and you have to sum them up. There will be terms of nCr in the solution and you need to compute nCr mod M , to do this efficiently, you will have to use Euler's theorem, or Extended Euclidean Algorithm. http://en.wikipedia.org/wiki/Modular_multiplicative_inverse To compute nCr mod P :
asked 19 Jan '15, 14:44
