F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Problem A. Integers Exhibition

Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)
Total Submission(s): 127    Accepted Submission(s): 50


Problem Description
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?
 

Input
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)$.
 

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

Sample Input
3 8 0 100 100 666 233
 

Sample Output
16 387 1507
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-20 18:39:07, Gzip enabled