#t98. 完全平方数计数
完全平方数计数
Counting Perfect Squares
Problem Description
Xiaoyang is studying perfect squares.
Square: the square of a number equals the number multiplied by itself.
Perfect square: a number that can be expressed exactly as the square of some positive integer.
For example, is a perfect square because ; but is not, because cannot be expressed as the square of any positive integer.
Given two positive integers and (it is guaranteed that ), Xiaoyang wants to know how many integers in the range from to inclusive are perfect squares.
Input Format
Two lines of input. The first line is a positive integer . The second line is a positive integer .
Output Format
Output a non-negative integer: the count of perfect squares among the integers from to . If there is no perfect square in , output .
Sample Input
1
21
Sample Output
4
Sample Explanation
For the sample, , . The perfect squares between and are , , , , four in total, so output .
Constraints