Marta bought 3 of fish A and 2 of fish B, and her tank holds 34 gallons.
So 3A + 2B = 34
Hank bought 3 of fish A and 4 of fish B, with a tank holding 50 gallons.
So, 3A + 4B = 50.
This works really well for both elimination and substitution methods. I like elimination for this one, and you'll see why below.
If we start with Hank's 50 gallon fish tank and moved his 3 As and 2 of his Bs into a tank identical to Marta's, that would be like starting with
3A +4B = 50
-( 3A +2B = 34)
2B = 16
And we'd be left with 2 fish B in 16 gallons of water.
So, One of fish B should be kept in 8 gallons. It's 8 inches long.
Take that answer for B and plug it back into either Marta's or Hank's original equations from earlier to find how many gallons (and how many inches) each of fish A is.