SP25 POUR1 - Pouring water

Description

Given two vessels, one of which can accommodate _a_ litres of water and the other - _b_ litres of water, determine the number of steps required to obtain exactly _c_ litres of water in one of the vessels. At the beginning both vessels are empty. The following operations are counted as 'steps': - emptying a vessel, - filling a vessel, - pouring water from one vessel to the other, without spilling, until one of the vessels is either full or empty.

Input Format

N/A

Output Format

N/A