/* Jive turkeys puzzle in Picat. From Martin Chlond Integer Programming Puzzles: http://www.chlond.demon.co.uk/puzzles/puzzles2.html, puzzle nr. 5. Description : Jive turkeys Source : rec.puzzles """ 5. A butcher received an invoice for a consignment of 72 turkeys, but unfortunately it was smudged and a couple of figures were unreadable. All he could read was '-67.9-', with the first and last figures illegible. Nevertheless, being a 'rec.puzzler', he was able to work out the price of a turkey immediately. What was the price of a turkey? (rec.puzzles) """ This model was inspired by the XPress Mosel model created by Martin Chlond. http://www.chlond.demon.co.uk/puzzles/sol2s5.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 => N = 3, X = new_list(N), foreach(I in 1..2) X[I] #>= 0, X[I] #=< 9 end, 10000*X[1] + 6790 + X[2] #= 72*X[3], solve($[min(X[3])], X), writeln(X), printf("Price: %2.2f\n", X[3]/100), nl.