using JuMP
using Cbc

LP=Model(Cbc.Optimizer)
@variable(LP, x11>=0)
@variable(LP, x12>=0)
@variable(LP, x21>=0)
@variable(LP, x22>=0)
@variable(LP, x31>=0)
@variable(LP, x32>=0)
@variable(LP, z>=0)
@constraint(LP, x11+x21+x31<=z)
@constraint(LP, x12+x22+x32<=24)
@constraint(LP, x11+2*x12<=15)
@constraint(LP, 1.2*x21+3x22<=24)
@constraint(LP, 2*x31+3x32<=18)
@objective(LP, Max, x11+2*x12+1.2*x21+3*x22+2*x31+3*x32)
status= JuMP.optimize!(LP)

LP=Model(Cbc.Optimizer)
@variable(LP, x11>=0)
@variable(LP, x12>=0)
@variable(LP, x21>=0)
@variable(LP, x22>=0)
@variable(LP, x31>=0)
@variable(LP, x32>=0)
@variable(LP, z>=0)
@constraint(LP, x11+x21+x31<=z)
@constraint(LP, x12+x22+x32<=z)
@constraint(LP, x11+2*x12>=15)
@constraint(LP, 1.2*x21+3*x22>=24)
@constraint(LP, 2*x31+3*x32>=18)
@objective(LP, Min, z)
status= JuMP.optimize!(LP)

LP=Model(Cbc.Optimizer)
@variable(LP, x>=0)
@variable(LP, y>=0)
@constraint(LP, 4x+6y>=30)
@constraint(LP, 6x+2y>=20)
@constraint(LP, x+2y>=12)
@objective(LP, Min, 2x+3y)
status= JuMP.optimize!(LP)
println("X: $(JuMP.value(x))")
println("Y : $(JuMP.value(y))")
