GO Solution For UVa 884 - Factorial Factors. In this post we will see how we can solve this challenge in GoLang for UVa Online Judge.

Problem Description

The factorial function, n! = 1 · 2 · . . . · n, has many interesting properties. In this problem, we want to determine the maximum number of integer terms (excluding 1) that can be used to express n!. For example:

8! = 1 · 2 · 3 · 4 · 5 · 6 · 7 · 8 = 2 · 3 · 2 · 2 · 5 · 3 · 2 · 7 · 2 · 2 · 2 = 27 ·

...

You can find the full details of the problem Factorial Factors at UVa Online Judge

Sample Input

2
1000000
1996
5
8
123456

Sample Output

1
3626619
5957
5
11
426566

Solution: Please check the main.go snippet for the solution.

Solution originally posted at: Github by @codingsince1985