#P1348. Couple number

    ID: 345 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 3 上传者: 标签>数学福建省历届夏令营枚举,暴力位运算,按位

Couple number

Description

For an integer nn, if there exist two non-negative integers x,yx, y such that n=x2y2n = x^2 - y^2, then nn is called a Couple number.

Given a,ba, b, find how many Couple numbers are in the range [a,b][a, b].

Input Format

The input contains one line with two integers a,ba, b.

Output Format

Output one line with a single integer representing the answer.

1 10

7

Hint

Constraints

For all test points, it is guaranteed that 107a<b107-10^7 \le a < b \le 10^7, ba107b - a \le 10^7.

Translated by ChatGPT 5