"Factorise" a quadratic When learning to factorise quadratics in the form \$x^2 + ax + b\$, a common technique is to find two numbers, \$p, q\$ such that
$$pq = b \\
p + q = a$$
as, for such numbers, \$x^2 + ax + b = (x + p)(x + q)\$
You are to take two integers \$a, b \in (-\infty, +\infty)\$ and output the two integers \$p, q\$ such that
$$pq = b \\
p + q = a$$
You may take input in any convenient method and you may assume that a solution always exists.
This is code-golf so the shortest code in bytes wins
Test cases
2, -15 -&gt; 5, -3
-22, 85 -&gt; -5, -17
6, -16 -&gt; -2, 8
-8, -240 -&gt; -20, 12
-1, -272 -&gt; 16, -17
17, 16 -&gt; 1, 16
-4, 0 -&gt; 0, -4
3, -54 -&gt; 9, -6
13, 40 -&gt; 8, 5
-29, 198 -&gt; -11, -18
11, -12 -&gt; -1, 12
4, -320 -&gt; 20, -16
4, 4 -&gt; 2, 2
Scala 3, 49 44 bytes
a=&gt;b=&gt;(-b*b to b*b)map(p=&gt;a-p-&gt;p)find(_*_==b)

Try it onlne!
Takes (a)(b) and returns an Option[(Int, Int)]. It's now a little more inefficient since it goes from \$-b^2\$ to \$b^2\$ instead of \$-|b|\$ to \$|b|\$, including values that \$p\$ and \$q\$ could never be, but it saves 4 bytes.
a =&gt; b =&gt;
  (-b*b to b*b)              //Make a range of all possible q's and then some
    map(q =&gt; (a - q, q))     //Make a tuple of (p, q)
    find(_ * _ == b)         //Find a pair such that p * q = b