Problem:
Score : 400 points

Problem Statement

You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many Shichi-Go numbers (literally "Seven-Five numbers") are there?

Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.

Note

When a positive integer A divides a positive integer B, A is said to a divisor of B.
For example, 6 has four divisors: 1, 2, 3 and 6.

Constraints

1 \leq N \leq 100

N is an integer.

Input

Input is given from Standard Input in the following format:

N

Output

Print the number of the Shichi-Go numbers that are divisors of N!.

Sample Input 1

9

Sample Output 1

0

There are no Shichi-Go numbers among the divisors of 9! = 1 \times 2 \times ... \times 9 = 362880.

Sample Input 2

10

Sample Output 2

1

There is one Shichi-Go number among the divisors of 10! = 3628800: 32400.

Sample Input 3

100

Sample Output 3

543

Solution in C# (Mono 4.6.2.0) (judge verdict: Wrong Answer)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            //[summary]D - 756
            int n = int.Parse(Console.ReadLine());
            BigInteger upper = GetUpperLimit(n);

            //5x5x3 のパターン
            var numbers = GetShichigoByThreeNums(upper).ToList();

            //15x5, 25x3 のパターン
            var numbers2 = GetShichigoByTwoNums(upper, 14, 4).ToList();
            var numbers3 = GetShichigoByTwoNums(upper, 24, 2).ToList();

            //75x1 のパターン
            var numbers4 = GetShichigoByOneNum(upper).ToList();

            numbers.AddRange(numbers2);
            numbers.AddRange(numbers3);
            numbers.AddRange(numbers4);

            var dic = new Dictionary<BigInteger, string>();
            int count = 0;

            foreach(var num in numbers)
            {
                if (upper % num == 0)
                {
                    if (!dic.ContainsKey(num))
                    {
                        dic.Add(num, null);

                        count++;
                    }
                }
            }

            Console.WriteLine(count);
        }

        static IEnumerable<BigInteger> GetShichigoByOneNum(BigInteger upper)
        {
            for (int a = 2; a < 100; a++)
            {
                if (IsPrimeNumber(a))
                {
                    BigInteger result = (BigInteger)Math.Pow(a, 74);

                    if (result > upper)
                    {
                        break;
                    }
                    else
                    {
                        yield return result;
                    }
                }
            }
        }

        static IEnumerable<BigInteger> GetShichigoByTwoNums(BigInteger upper, int x, int y)
        {
            for (int a = 2; a < 100; a++)
            {
                if (IsPrimeNumber(a))
                {
                    BigInteger powA = (BigInteger)Math.Pow(a, x);

                    for (int b = 2; b < 100; b++)
                    {
                        if (a != b && IsPrimeNumber(b))
                        {
                            BigInteger powB = (BigInteger)Math.Pow(b, y);
                            BigInteger result = powA * powB;

                            if (result > upper)
                            {
                                break;
                            }
                            else
                            {
                                yield return result;
                            }
                        }
                    }
                }
            }
        }

        static IEnumerable<BigInteger> GetShichigoByThreeNums(BigInteger upper)
        {
            const int maxNum = 100;

            for(int a = 2; a < maxNum; a++)
            {
                if (IsPrimeNumber(a))
                {
                    BigInteger powA = (BigInteger)Math.Pow(a, 2);

                    for (int b = 2; b < maxNum; b++)
                    {
                        if (a != b && IsPrimeNumber(b))
                        {
                            BigInteger powB = (BigInteger)Math.Pow(b, 4);

                            for (int c = 2; c < maxNum; c++)
                            {
                                if (a != c && b != c && IsPrimeNumber(c))
                                {
                                    BigInteger powC = (BigInteger)Math.Pow(c, 4);
                                    BigInteger result = powA * powB * powC;

                                    if (result > upper)
                                    {
                                        break;
                                    }
                                    else
                                    {
                                        yield return result;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        static bool IsPrimeNumber(int num)
        {
            var primeNumbers = new List<int> {
                2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47,
                53, 59, 61, 67, 71, 73, 79, 83, 89, 97 };

            if (primeNumbers.Contains(num))
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        static BigInteger GetUpperLimit(int n)
        {
            BigInteger result = 1;

            for(int i = 2; i <= n; i++)
            {
                result *= i;
            }

            return result;
        }
    }
}