|
5 men, 25 women, and 70 children
Xpress-Mosel Model
model 'abpuzzle'
! Description : The Abbott's Puzzle
! Source : Dudeney, H.E., (1917), Amusements in Mathematics, Thomas Nelson and Sons.
! Date written : 29/11/99
! Written by : M J Chlond
uses 'mmxprs'
declarations
S = 1..3
amount: array(S) of real
x: array(S) of mpvar
end-declarations
amount:= [3,2,.5]
any:= x(1)
con1:= sum(i in S) amount(i)*x(i) = 100
con2:= sum(i in S) x(i) = 100
con3:= x(2) = 5*x(1)
forall(i in S)
x(i) is_integer
minimise(any)
forall(i in S)
write(getsol(x(i)),' ')
end-model
|