The slope can be found by using the formula: #m = (color(red)(y_2) - color(blue)(y_1))/(color(red)(x_2) - color(blue)(x_1))#
Where #m# is the slope and (#color(blue)(x_1, y_1)#) and (#color(red)(x_2, y_2)#) are the two points on the line.
Substitute the values given in the problem and solve for #K#:
#1 = (color(red)(4) - color(blue)(-K))/(color(red)(-1) - color(blue)(2))#
#1 = (4 + color(blue)(K))/(-3)#
#color(red)(-3) xx 1 = color(red)(-3) xx (4 + color(blue)(K))/(-3)#
#-3 = cancel(color(red)(-3)) xx (4 + color(blue)(K))/(color(red)(cancel(color(black)(-3))))#
#-3 = 4 + color(blue)(K)#
#-3 - color(red)(4) = 4 + color(blue)(K) - color(red)(4)#
#-3 - color(red)(4) = 4 - color(red)(4) + color(blue)(K)#
#-7 = 0 + color(blue)(K)#
#-7 = color(blue)(K)#
#color(blue)(K) = -7#