You get 2 jugs of the 5 gallons and then take out 3 gallons using the 3 gallon jug. You end up getting 10-3=7 gallons.
To measure 7 gallons using a 3-gallon and a 5-gallon jug, first fill the 5-gallon jug and pour into the 3-gallon jug until it is full, leaving 2 gallons in the 5-gallon jug. After emptying the 3-gallon jug, pour the 2 gallons from the 5-gallon jug into it, refill the 5-gallon jug, and pour into the 3-gallon jug until it is full, which results in 4 gallons remaining in the 5-gallon jug. Hence, you have successfully measured 7 gallons of water.
;