To celebrate a diners anniversary, the owners have made a 40 foot long sandwich. The sandwich is cut into three unequal pieces.
The longest piece is three times as long as the middle piece, and the shortest piece is 5 feet shorter than the middle piece. What is the length of the longest piece?