Valentine Time <3
Practice
5 (1 votes)
Very Easy
Problem
7% Success 451 Attempts 10 Points 5s Time Limit 256MB Memory 1024 KB Max Code

It's Valentine Time . Love is in Air . So, Mr. Pole is looking for bride . For becoming his bride , there is only one criteria. She should be expert in Coding . So, Mr.Pole has given a question for 1st Elimination round :

Given a range L and R , you have to tell the number between L and R such that difference between no. of divisors and prime divisors is maximum. If two number has same difference , print the smallest one .

Input : First line contains T , denoting number of Test cases Next T lines contains L and R denoting the range for the query.

Output : Print the desired result in each line.

Constraints :

1<=T<=10

1<=L<=R<=10^6

AUTHOR : trico

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:10
10 votes
Tags:
Integer FactorizationAlgorithmsMathMathamaticsFactorizationNumber Theory
Points:10
1 votes
Tags:
Prime FactorizationVery-EasyVery-Easy
Editorial

No editorial available for this problem.