-->
当前位置:首页 > 题库

编程题:Integer Solution

Luz3年前 (2022-11-26)题库532
There are two integers $x$ and $y$. The sum of $x$ and $y$ equals an integer $n$ and $x$ multiplied by $y$ equal to another integer $m$. Does $x$ and $y$ exist or not? Can you answer quickly? It seems that the problem can only be solved by programming.

$x+y=9,x*y=15?$
can not find the integer $x$ and $y$

$x+y=5,x*y=4?$
$x=4,y=1$ or $x=1,y=4$

$x+y=-1,x*y=-56? $
$x=7,y=-8$ or $x=-8,y=7$

### Input:

The input data is a pair of integers $n$ and $m$,which represent sum and product respectively.If $n$ and $m$ both are 0, the input ends.$(-10000<n,m<10000)$


### Output:

For each n and m,output "yes" or "no",represent whether the integer x and y exist.

### Sample Input:



in
9 15
5 4
-1 -56
0 0


### Sample Output:



out
no
yes
yes







答案:若无答案欢迎评论