QOJ.ac

QOJ

実行時間制限: 3 s メモリ制限: 512 MB 満点: 100

#15783. Pseudo-smooth numbers

統計

An integer $M > 1$ is called an $N$-pseudo-smooth number if its prime factorization has $k$ terms, its largest prime factor is $a_k$, and it satisfies ${a_k}^k \leq N$ and $a_k < 128$.

Given $N$, find the $K$-th largest $N$-pseudo-smooth number among all such integers.

Input

A single line containing two space-separated integers $N$ and $K$.

Output

A single line containing an integer representing the answer.

Subtasks

For $30\%$ of the data, $N \leq 10^6$.

For $100\%$ of the data, $2 \leq N \leq 10^{18}$ and $1 \leq K \leq 800000$. It is guaranteed that there are at least $K$ such numbers.

Examples

Input 1

12345 20

Output 1

9167

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.