题库练习 Square Equation Roots
← 上一题 下一题 →

A8041 | Square Equation Roots

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

A schoolboy Petya studies square equations. The equations that are included in the school curriculum, usually look simple:

$x^{2}+2bx+c=0$ where $b$ , $c$ are natural numbers.Petya noticed that some equations have two real roots, some of them have only one root and some equations don't have real roots at all. Moreover it turned out that several different square equations can have a common root.

Petya is interested in how many different real roots have all the equations of the type described above for all the possible pairs of numbers $b$ and $c$ such that $1<=b<=n$ , $1<=c<=m$ . Help Petya find that number.

输入格式

The single line contains two integers $n$ and $m$ . ( $1<=n,m<=5000000$ ).

输出格式

Print a single number which is the number of real roots of the described set of equations.

输入输出样例

输入 #1
3 3
输出 #1
12
输入 #2
1 2
输出 #2
1
C++ 编辑器
输入
输出