Measuring liquid puzzle

Today we will look at a brainteaser puzzle: "how to measure out exactly 1 liter of water using a 3-liter jug and a 5-liter jug." We will analyse this puzzle to see that, despite its innocent look, this puzzle has a close connection with the linear Diophantine equation.