#P4706. Soldier and Number Game
Soldier and Number Game
Soldier and Number Game
题面翻译
给你表示表示的数,你每次可以对 这个数除以且为这个数的因子使他变成, 问你 最多可以操作多少次使这个数变成
翻译提供者:Labelray
题目描述
Two soldiers are playing a game. At the beginning first of them chooses a positive integer and gives it to the second soldier. Then the second one tries to make maximum possible number of rounds. Each round consists of choosing a positive integer x>1 , such that is divisible by and replacing with . When becomes equal to and there is no more possible valid moves the game is over and the score of the second soldier is equal to the number of rounds he performed.
To make the game more interesting, first soldier chooses of form for some positive integer and ( ). Here by we denote the factorial of that is defined as a product of all positive integers not large than .
What is the maximum possible score of the second soldier?
输入格式
First line of input consists of single integer ( ) denoting number of games soldiers play.
Then follow lines, each contains pair of integers and ( ) defining the value of for a game.
输出格式
For each game output a maximum score that the second soldier can get.
样例 #1
样例输入 #1
2
3 1
6 3
样例输出 #1
2
5