Well.....tt's a little hard to tell.....but one side of the deck = sqrt(140) = 2sqrt(35) ft.
So.....the total perimeter is 4 *2sqrt(35) ft = 8sqrt(35) ft
Under the first option only 1/2 of the perimeter of the deck needs to have railings = 2 * 2sqrt(35) ft =
4sqrt(35)ft
Under the second option, 3/4 of the perimeter needs to have railings = 3 * 2sqrt(35) ft = 6sqrt(35) ft
So......the first option is better......and the minimum length needed is 4sqrt(35) ≈ 47.33 ft