A square number is an integer number whose square root is also an integer. For example 1, 4, 81 are some square numbers. Given two numbers a and b you will have to find out how many square numbers are there between a and b (inclusive).

Input

The input file contains at most 201 lines of inputs. Each line contains two integers a and b (0 < a ≤ b ≤ 100000). Input is terminated by a line containing two zeroes. This line should not be processed.

Output

For each line of input produce one line of output. This line contains an integer which denotes how many square numbers are there between a and b (inclusive).

Sample Input

1 4

1 10

0 0

Sample Output

2

3

 1 #include <iostream>
 2 #include <cmath>
 3 #include <stdio.h>
 4 using namespace std;
 5 
 6 int main()
 7 {   int a,b,n;
 8     float m;
 9     while(~scanf("%d%d",&a,&b))
10 {    n=0;
11      if(a>0&&a<=b){
12     for(int i=a;i<=b;i++)
13     {  m=sqrt(i);
14         if(m-(int)m==0)
15         n+=1;
16     } printf("%d\n",n);
17 }
18 }
19     return 0;
20 }

优质内容筛选与推荐>>
1、owasp对项目依赖的jar包安全扫描
2、Django重定向你是如何实现的?用的什么状态码?
3、[LeetCode] 619. Biggest Single Number_Easy tag: SQL
4、[转]深入理解.NET内存回收机制
5、eclipse +maven+ssm搭建矿建


长按二维码向我转账

受苹果公司新规定影响,微信 iOS 版的赞赏功能被关闭,可通过二维码转账支持公众号。

    阅读
    好看
    已推荐到看一看
    你的朋友可以在“发现”-“看一看”看到你认为好看的文章。
    已取消,“好看”想法已同步删除
    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号