Thanks Chris, I am going to show how to do it another way.
your way always works (so long as there really is a solution) , mine only works for whole numbers.
the product of x and y equals -340 and the sum of x and y equals -3
If I am trying to factoize a quadratic and I am expecting integer answers (whole numbers)
I often use a 'guess' method.
1) They multiply to a neg number so one is positive and one is negative.
2) They add to a negative so the 'bigger' one is negative.
3) now I more or less forget about the negative signs for a bit.
4) they add to -3 so the numbers are close in value - only 3 apart.
5) Now I am going to look for factors of 340 that suit this.
340 = 34*10 = 2*17*2*5 = 2*2*5*17 = 20*17 that looks helpful, they are 3 apart
6) Must be -20 and +17