/* Price of a turkey in Picat. https://matmod.ch/blog/2024/02/04/price-of-a-turkey-math13/ """ 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 "puzzler", he was able to work out the price of a turkey immediately. What was the price of one turkey? (see [1]). """ (The reference [1] is to a Martin Chlond site, now defunct: http://www.chlond.demon.co.uk/academic/puzzles.html ) Via https://github.com/the-faisalahmed/Optimization/blob/main/misc%20puzzles%20%26%20problems/Price_of_a_Turkey.ipynb Solution: turkey = 511 total = 367.92 = [3,6,7,9,2] This program was created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ import cp. main => go. go ?=> [A,B] :: 0..9, 72*Turkey #= A*10000 + 6*1000 + 7*100 + 9*10 + B, solve([A,B,Turkey]), println(turkey=Turkey), println(total=(72*Turkey/100)=[A,6,7,9,B]), fail, nl. go => true.