You are viewing a single comment's thread. Return to all comments →
The task is not about Functional Programming. It's a pure Number theory.
Yep, that's why it's placed in MISC chapter :)
You wouldn't happen to have a handy link the number theory side of it would you?
It's possible to fiddle with lists of factors to keep numbers small, and that would be Number Theory.
But it's also possible to do what I did and use some implementation of Big Integers to actually simply multiply those numbers out, find their GCD, modulo it to 1000000007 and print it out.