Use 19, and subtract each number. For example, if it is 15, you do 19 - 15, but if it is over 19, like 24, do 24 - 19. Do this to all the numbers and add them up, thats your mad.
You want to know the value of x that makes y=1000. You can plug the equation in to your calculator or desmos. Look at the table for when y=1000. X is 26.
To check, plug in 26 for x. 26^2 + 20(26) - 196 = 1000.