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

Yukikaze and Smooth numbers

Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)
Total Submission(s): 251    Accepted Submission(s): 109


Problem Description
Yukikaze is learning number theory. In number theory, a $k$-smooth number is an integer whose prime factors are all less or equal to $k$ . Given $n$ and $k$, she wants to know how many $k$-smooth numbers are less or equal to $n$.
 

Input
The input contains several test cases, and the first line contains a single integer $T(1¡ÜT¡Ü50)$, the number of test cases. Each of the next T lines contains two integers $n(1 \leq n \leq 10^9), k(1 \leq k \leq 10^9)$, denoting the question described above.
 

Output
For each test case, output the answer in a single line.
 

Sample Input
5 13 2 75 18 38 8 24 7 62 9
 

Sample Output
4 54 25 18 34
 

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-11-23 17:38:39, Gzip enabled