P1748 H Number

Description

An H number is a number that has no prime factors other than $2, 3, 5, 7$. For example, $630$ is an H number, whereas $22$ is not. In particular, $1$ is the smallest H number. Now, output the $n$-th smallest H number.

Input Format

A positive integer $n\ (1 \le n \le 10^4)$.

Output Format

A single positive integer representing the answer. It can be proven that the answer will not exceed $2^{63}-1$.

Explanation/Hint

Translated by ChatGPT 5