Bala

Bala

  • NA
  • 1
  • 504

solve this puzzle??

Nov 3 2015 1:57 AM
Write a program that takes three integers, first two the size of two jars and third the desired quantity,
and print out steps to get the desired quantity.
For example, if you have two jars which can measure 3 liters and 5 liters, how would you measure exactly 4 liters
Hint: Size of jar 1 and jar 2 are relatively prime and the desired size is less than that of the jar 2 size.
E.g.
Input
-----
Size of Jar1: 7
Size of Jar2: 13
Desired: 10