/* Bananas problem in Picat. """ In three dollars, you get 5 bananas, in five dollars, 7 oranges, in seven dollars, 9 mangoes and in nine dollars, three apples, I need to purchase 100 fruits in 100 dollars. Please keep in mind that all type of fruits need to be purchased but I do not like banana and apple, so these should be of minimum quantity. """ This Picat model was created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ % import util. import mip. main => go. go => X = [Bananas, Oranges,Mangoes,Apples], X :: 1..100, TheSum #= Bananas+Apples, 3*Bananas*189 + 5*Oranges*135 + 7*Mangoes*105 + 9*Apples*315 #= 100*945, sum(X) #= 100, solve($[min(TheSum)], X), writeln(theSum=TheSum), writeln(x=X), nl.