We have two water jugs A and B, one measures X Gallons while the other measure Y Gallons. But there is no measuring label mentioned on either of these two jugs i.e. we cannot know the exact amount filled in the jug. Now, assuming there is an infinite amount of water supply, can we measure any arbitrary measurement Z using these unmarked jugs.
Hint: We can empty the jugs, and transfer water from one jug to other.