English version:
The first problem is similar to Problem G — Inverse Factorial in 2016 ICPC North American Qualifier Contest; however, there is a twist: if there is no n for the given value n!, you need to output - 1.
I think there is a solution for this problem, but I can not find it :)
By the way, a gifted 9-grader in Vietnam has no idea about FFT anything similar to that.