All Submissions


Problem Statement
Given two number a and b.Count how many numbers in the range a to b(including both a and b) has odd number of divisors.

Input
First line of input contains number of test cases T.Each of the next T lines contains two number a and b.

Output
For each test case output a single line containing resulting count.

Constraints

T<=100
1<=a<=b<=10^12

Sample Input


1
2 5

Sample Output


1

Explanation

Divisors of 2:1,2
Divisors of 3:1,3
Divisors of 4:1,2,4
Divisors of 5:1,5
So only 4 has odd number of divisors which gives count as 1.

Problem Setter : Abhishek Sanghai

Languages: C,C++,Java

Time Limit: 1 Second(s)
Score: 100 Point(s)
Input File Limit: 50000 Bytes

Submit

Login to post clarification.

No Clarifications.

Contest

Mode Judge

Passive

Online

Overall Rankings

RankNameScore
1xyz0
2Ams0
3TIP0
4team420
5xyzz0
6asdasdasd0
7abcd0
8khankhan0
9Gabriel0
10gigel0