#t441. H数

H数

H-numbers

Problem Background

Special for beginners, ^_^

Problem Description

An H-number is a number whose prime factors contain only 2,3,5,72,3,5,7, such as 630630 which is an H-number, while 2222 is not. Now output the nn-th H-number. For convenience, define H[1]=1H[1]=1. It is known that 1≤n≤100001\le n\le 10000, and the final data is within the range of int64.

Input Format

One number nn (as described).

Output Format

The nn-th H-number.

Sample Input 1

30

Sample Output 1

49

Sample Input 2

1

Sample Output 2

1

Hint

Brute force enumeration will overflow; use a generation method, preferably with optimization, otherwise the space complexity will be large.

Constraints

Time limit 1s, memory limit 1024KiB for each test case.