/* Tobacco problem in Picat. From Martin Chlond Integer Programming Puzzles: http://www.chlond.demon.co.uk/puzzles/puzzles2.html, puzzle nr. 1. Description : Clarke's tobacconist Source : Clarke, L.H., (1954), Fun with Figures, William Heinemann Ltd. """ A tobacconist bought a quantity of pipes at 2s. 1d. each and others at 4s. 1d. each. He spent in all 8 6s. 8d. on the pipes. How many of each kind did he buy? (Clarke) """ This model was inspired by the XPress Mosel model created by Martin Chlond. http://www.chlond.demon.co.uk/puzzles/sol2s1.html This Picat model was created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ import cp. main => go. go ?=> X = new_list(2), foreach(I in 1..2) X[I] #>= 0 end, 25*X[1] + 49*X[2] #= 2000, solve(X), println(X), fail, nl. go => true.