One Root
Time limit2sMemory limit512 MB
Count pairs (p, q) with |p|, |q| <= m for which x^n + px + q has exactly one real root.
- Level
Hard9 of 10
- Topics
- Math, Number theory, Dynamic programming, Implementation
- Solved
- No attempts yet
Problem
For a fixed and integers and such that and , how many equations of the form
have exactly one real root?
Input
The only line of input contains two integers and (, ).
Output
Print a single integer: the number of equations having exactly one real root.