7501: Yukikaze and Smooth numbers

内存限制:128 MB 时间限制:1 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:0 通过:0

题目描述

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 nand k, she wants to know how many k-smooth numbers are less or equal to n.

输入格式

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≤n≤109),k(1≤k≤109), denoting the question described above.

输出格式

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

输入样例 复制

5
13 2
75 18
38 8
24 7
62 9

输出样例 复制

4
54
25
18
34