传统题 1000ms 1024MiB

Divisor Dash

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

Description

Viznan has an instant-kill skill, but its activation condition is demanding.

Let d(n)d(n) denote the number of positive divisors of nn. When facing an enemy with xx health points, the amount of damage Viznan must deal to activate the skill is

max1iyd(xi).\max_{1\leq i\leq y} d(x\cdot i).

Given xx and yy, calculate the required amount of damage.

Input Format

This problem contains multiple test cases.

The first line contains two integers TT and idid, where TT is the number of test cases and idid is the test-data identifier. The value of idid does not affect the answers.

Each of the next TT lines contains two integers xx and yy, describing one test case.

Output Format

For each test case, output the value of max1iyd(xi)\max\limits_{1\leq i\leq y} d(x\cdot i) on a separate line.

Sample

Input #1

3 0
5 5
10 5
6 10

Output #1

6
8
12

Sample Explanation

For the first test case, d(5)=2d(5)=2, d(10)=4d(10)=4, d(15)=4d(15)=4, d(20)=6d(20)=6, and d(25)=3d(25)=3. Therefore, the answer is 66.

For the second test case, d(10)=4d(10)=4, d(20)=6d(20)=6, d(30)=8d(30)=8, d(40)=8d(40)=8, and d(50)=6d(50)=6. Therefore, the answer is 88.

For the third test case, d(6)=4d(6)=4, d(12)=6d(12)=6, d(18)=6d(18)=6, d(24)=8d(24)=8, d(30)=8d(30)=8, d(36)=9d(36)=9, d(42)=8d(42)=8, d(48)=10d(48)=10, d(54)=8d(54)=8, and d(60)=12d(60)=12. Therefore, the answer is 1212.

Constraints

For all test cases:

  • 1T101\leq T\leq 10;
  • 1x,y10101\leq x,y\leq 10^{10}.

Hello ACM 2026

未参加
状态
已结束
规则
ACM/ICPC
题目
13
开始于
2026-8-15 13:00
结束于
2026-8-15 18:00
持续时间
5 小时
主持人
参赛人数
31