#P8316. [CQOI2016] 伪光滑数 加强版

    ID: 9172 远端评测题 1000ms 256MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>动态规划 DP2016重庆各省省选优先队列可并堆可持久化素数判断,质数,筛法

[CQOI2016] 伪光滑数 加强版

Background

Original problem link: P4359 [CQOI2016] Pseudo-Smooth Numbers.

Problem Description

For an integer m>1m > 1, suppose its prime factorization with multiplicity has kk factors, and its largest prime factor is aka_k. If it satisfies akkna_{k}^{k} \leq n and ak397a_k \leq 397, then we call mm an nn-pseudo-smooth number.

Given an integer nn, find the kk-th largest nn-pseudo-smooth number.

Input Format

One line with two integers n,kn, k.

Output Format

One line with one integer, representing the required value.

12345 20
9167

Hint

For 100%100\% of the testdata, 1<n10111 < n \leq 10^{11}, k1k \geq 1, and it is guaranteed that there are at least kk numbers that satisfy the conditions.

Translated by ChatGPT 5