Hi, i really need help figuring two problems out.

problem 1

the perimeter of a rectangular picture is 34cm. the diagonal is 13cm. find the dimensions of this picture.

how on earth do i figure this out?

problem 2

Find the distance (correct to three decimal places) from the point (-5,-2) to the line 3x+y=8. Hint: the distance from a point to a line is the perpendicular distance.

please help me!!