using JuMP
using Clp

#Preparing optimization model
m = Model(Clp.Optimizer)

# Declaring variables
@variable(m, 0 <= x1 <=10)
@variable(m, x2 >=0)
@variable(m, x3 >=0)

#Setting the objective function
@objective(m, Max, x1 + 2x2 + 5x3)

#Adding constraints
@constraint(m, constraint1, -x1 + x2 + 3x3 <= -5)
@constraint(m, constraint2, x1 + 3x2 - 7x3 <= 10)

#Printing the prepared optimization model
print(m)

# Solving the optimization problem
optimize!(m)

# Printing the optimal solutions obtained
println("Optimal Solutions:")
println("x1 = ", JuMP.value(x1))
println("x2 = ", JuMP.value(x2))
println("x3 = ", JuMP.value(x3))

# Printing the optimal dual variables
println("Dual Variables:")
println("dual1 = ", JuMP.dual(constraint1))
println("dual2 = ", JuMP.dual(constraint2))
