## Favourite Numbers

View as PDF

Points: 7 (partial)
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type

Out of all the numbers that exist, justinzhu only likes some specific numbers. The only numbers that he like are numbers, if prime factorized, only contain the numbers 2 or 3. However, since justinzhu really likes to be number 1 (even though that never happens), the smallest number that he likes is the number 1.

Out of all these numbers, justinzhu would like for you to write a solution that finds the smallest number that he likes.

#### Input Specification

One Integer , the number that he is looking for.

#### Output Specification

One Value, the smallest number in the list of numbers that justinzhu likes.

#### Sample Input 1

5

#### Sample Output 1

6

#### Explanation for Sample Output 1

The first 5 numbers that justinzhu likes are . Thus, the 5th one is , the one he is looking for.

#### Sample Input 2

8

#### Sample Output 2

12

#### Explanation for Sample Output 2

The next 3 numbers are , so is the answer.

#### Sample Input 3

50

#### Sample Output 3

2304