The sides of a pentagon are represented by x, x+2, x+5, 2x+2, and 3x-1. If the perimeter is 56, find the length of the longest side.
A)18 B)19 C)17 D)14