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++14 (GCC 5.4.1) (judge verdict: Runtime Error)

#include <bits/stdc++.h>
using namespace std;

string to_string(string s) {
	return '"' + s + '"';
}

string to_string(bool b) {
	return (b ? "true" : "false");
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
	return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A>
string to_string(A v) {
	bool first = true;
	string res = "{";
	for (const auto &x : v) {
		if (!first) {
			res += ", ";
		}
		first = false;
		res += to_string(x);
	}
	res += "}";
	return res;
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
	cerr << " " << to_string(H);
	debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

void test_case() {
	int n;
	cin >> n;
	map<int, int> cnt;
	for (int i = 1; i <= n; ++i) {
		int x = i;
		for (int f = 2; f * f <= x; ++f) {
			while (x % f == 0) {
				++cnt[f];
				x /= f;
			}
		}
		if (x != 1) {
			++cnt[x];
		}
	}
	debug(cnt);
	vector<pair<int, int>> v_cnt;
	for (auto i : cnt) {
		v_cnt.push_back(i);
	}
	set<long long> unq;
	function<void(int, int, long long)> solve = [&](int ind, int num, long long x) {
		if (num == 1) {
			unq.insert(x);
			return;
		} else if (ind == v_cnt.size() + 1) {
			return;
		}
		long long p = 1; 
		for (int take = 0; take <= v_cnt[ind].second; ++take) {
			if (num % (take + 1) == 0) {
				solve(ind + 1, num / (take + 1), x * p);
			}
			p *= v_cnt[ind].first;
		}
	};
	solve(0, 75, 1);
	cout << unq.size() << "\n";
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	test_case();
	return 0;
}