301147: CF214A. System of Equations

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:2 Solved:0

Description

System of Equations

题意翻译

# 题目描述 Furik "非常喜欢" 数学课, 所以他从不去上课, 不像 Rubik. 但是现在Furik想要得到一个好一点的数学成绩. 为此, 他的数学老师Ms. Ivanova给了他一个新任务. Furik一瞬间就搞定了. 你行吗? 给你一个如下的等式方程组: ![](https://cdn.luogu.org/upload/vjudge_pic/CF214A/62e1cfae0726c97a669dda13cb6a561eafa52412.png)你的任务是计算, 有多少组整数(a,b)(0<=a,b)满足这个方程组. # 输入输出格式 ## 输入格式: 仅一行, 包含两个整数 n,m (1<=n,m<=1000) — 该方程组的参数. 由一个空格分隔. ## 输出格式: 输出答案, 仅一行.

题目描述

Furik loves math lessons very much, so he doesn't attend them, unlike Rubik. But now Furik wants to get a good mark for math. For that Ms. Ivanova, his math teacher, gave him a new task. Furik solved the task immediately. Can you? You are given a system of equations: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF214A/62e1cfae0726c97a669dda13cb6a561eafa52412.png)You should count, how many there are pairs of integers $ (a,b) $ $ (0<=a,b) $ which satisfy the system.

输入输出格式

输入格式


A single line contains two integers $ n,m $ $ (1<=n,m<=1000) $ — the parameters of the system. The numbers on the line are separated by a space.

输出格式


On a single line print the answer to the problem.

输入输出样例

输入样例 #1

9 3

输出样例 #1

1

输入样例 #2

14 28

输出样例 #2

1

输入样例 #3

4 20

输出样例 #3

0

说明

In the first sample the suitable pair is integers $ (3,0) $ . In the second sample the suitable pair is integers $ (3,5) $ . In the third sample there is no suitable pair.

Input

题意翻译

# 题目描述 Furik "非常喜欢" 数学课, 所以他从不去上课, 不像 Rubik. 但是现在Furik想要得到一个好一点的数学成绩. 为此, 他的数学老师Ms. Ivanova给了他一个新任务. Furik一瞬间就搞定了. 你行吗? 给你一个如下的等式方程组: ![](https://cdn.luogu.org/upload/vjudge_pic/CF214A/62e1cfae0726c97a669dda13cb6a561eafa52412.png)你的任务是计算, 有多少组整数(a,b)(0<=a,b)满足这个方程组. # 输入输出格式 ## 输入格式: 仅一行, 包含两个整数 n,m (1<=n,m<=1000) — 该方程组的参数. 由一个空格分隔. ## 输出格式: 输出答案, 仅一行.

加入题单

上一题 下一题 算法标签: