ARC108A - Sum and Product
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Time Limit: 2 sec / Memory Limit: 1024 MB
Score : 300 points
Problem Statement
Given are integers S and P. Is there a pair of positive integers (N,M) such that N+M=S and N×M=P?
Constraints
- All values in input are integers.
- 1≤S,P≤1012
Input
Input is given from Standard Input in the following format:
S P
Output
If there is a pair of positive integers (N,M) such that N+M=S and N×M=P, print Yes
; otherwise, print No
.
Sample Input 1
3 2
Sample Output 1
Yes
- For example, we have N+M=3 and N×M=2 for N=1,M=2.
Sample Input 2
1000000000000 1
Sample Output 2
No
- There is no such pair (N,M).
军训训练赛1
- Status
- Done
- Rule
- IOI
- Problem
- 7
- Start at
- 2023-8-20 8:00
- End at
- 2023-8-20 11:00
- Duration
- 3 hour(s)
- Host
- Partic.
- 12