ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1091. Tmutarakan Exams

This problem is harder than the rating he has
Posted by scythe 24 Nov 2011 01:52
some hints:
use pascal triangle to generate c(n,k) if you use 63 bits data type all will fit.
prime factorize each number
for each prime count the number of number where he is a factor
calculate number of posibilites
remove duplicates ( this is what makes this problem a little bit harder ).

Good luck.
Re: This problem is harder than the rating he has
Posted by lakerka 18 May 2015 00:47
scythe wrote 24 November 2011 01:52
remove duplicates ( this is what makes this problem a little bit harder ).
If you don't know how to do this part take a look at derivation of Euler's totient function.