### Wjexmrc's blog

By Wjexmrc, history, 2 weeks ago, ,

Hi I'm unable to solve the following problem spoj problem . I've tried but can't deduce anything , any hints/ideas are welcome.

• +6

 » 12 days ago, # |   0 anyone?
 » 10 days ago, # |   +3 I can suggest you the following strightforward approach: derive or find the exact formula $S(n) = \Large \sum\limits_{d|n} \frac{n!}{d!\,(\frac{n}{d}!)^d}$ represent large numbers as its prime factorisation; i've used struct component { short cnt[1229]; }; where 1229 is the number of prime numbers till 10000 ($N_{max} \times K_{max}$) and cnt is the power of corresponding prime number in order to transform all multiplications and divisions to additions and substractions use optimised bigint library for converting factoring numbers into digital form.
•  » » 7 days ago, # ^ |   0 Thanks for replying i finally understood how to derive the formula and got it accepted.