Factorial and fourth degree

EOlymp - 649