Programming contests

ACM ICPC programozó csapatverseny, országos forduló, gyakorló feladatsor, 2013. október 27.

October 27, 2013, 9:00 AM – October 27, 2013, 10:00 AM

Square Numbers

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 Specification

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 Specification

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. 1 4
  2. 1 10
  3. 0 0
download as text file

Output for Sample Input

  1. 2
  2. 3
download as text file
University of Debrecen; Faculty of Informatics; v. 09/30/2024