Problem A. Problem A. Integers Exhibition

时间限制 5000 ms   内存限制 256 MB

Kazari loves math, she has been fascinated by divisors recently.
She defines a positive integer $x$ $K$-magic if and only if there are more than $K$ integers $y$ where

* $0 < y < x$.
* $y$ has more divisors than $x$.

To show her research for those who loves math, she plans to hold an exhibition listing $K$-magic integers from small to large. Can you help her calculate the $N$-th integer in this exhibition?
 

输入数据

The first line of the input contains an integer $T$ $(1 \le T \le 10 ^ 5)$ denoting the number of test cases.
Each test case consists of one line with two integers $N, K$ $(1 \le N \le 10 ^ {18}, 0 \le K \le 233)$.
 

输出数据

For each test case, print an integer denoting the $N$-th $K$-magic integer.
 

样例输入

复制
3
8 0
100 100
666 233

样例输出

复制
16
387
1507

提交

请先 登录

© 2025 FAQs Contact About