HackerRank: Sherlock and Squares

Problem Statement

Watson gives two integers (and B) to Sherlock and asks if he can count the number of square integers between and (both inclusive).

Note: A square integer is an integer which is the square of any integer. For example, 1, 4, 9, and 16 are some of the square integers as they are squares of 1, 2, 3, and 4, respectively.

Input Format
The first line contains T, the number of test cases. test cases follow, each in a new line.
Each test case contains two space-separated integers denoting and B.

Output Format
For each test case, print the required answer in a new line.


Sample Input

3 9
17 24

Sample output


Test Case #00: In range [3,9], 4 and 9 are the two square numbers.
Test Case #01: In range [17,24], there are no square numbers.



One Reply to “HackerRank: Sherlock and Squares”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.