Omar owns a car and a moped. He can afford 12 gal of gasoline to be split between the car and the moped. Omar's car gets 20 mpg and, with the fuel currently in the tank, can hold at most an additional 10 gal of gas. His moped gets 100 mpg and can hold at most 3 gal of gas. How many gallons of gasoline should each vehicle use if Omar wants to travel as far as possible on the 12 gal of gas? What is the maximum number of miles that he can travel?

let the number of gallons to go into the moped be x.

let the number of gallons for the car be 12-x

restrictions:
x<=3 and 12-x <=10
x<=3 and x>=2

distance he can go by moped is 100x miles
distance he an go by car is 20(12-x) = 240 - 20x
so the total distance he can go is 80x+240 miles

but the largest x we can have is x=3
so he can go 80*3+240 = 480 miles

this of course is the distance he can go using only the 12 gallons, it doesn't say how much gas there was in the car to begin with.

To determine how many gallons of gasoline each vehicle should use, we need to consider the distance each vehicle can travel per gallon of gasoline.

Let's start with the car:
- The car gets 20 miles per gallon (mpg).
- It can hold at most an additional 10 gallons of gas.
- Therefore, the car can travel up to 20 mpg * 10 gallons = 200 miles on the gas currently in the tank.

Now, let's move on to the moped:
- The moped gets 100 miles per gallon (mpg).
- It can hold at most 3 gallons of gas.
- Therefore, the moped can travel up to 100 mpg * 3 gallons = 300 miles on the gas it can hold.

To maximize the total distance traveled with the 12 gallons of gas available, Omar should allocate the gasoline in such a way that he uses the car's fuel first and then the moped's fuel.

Since the car's maximum distance is 200 miles and the moped's maximum distance is 300 miles, we can allocate the gas accordingly:

1. The car: To maximize the car's distance of 200 miles, Omar should use a maximum of 10 gallons of gas in the car since it can hold only an additional 10 gallons.
2. The moped: Omar can then use the remaining 2 gallons of gas in the moped since the total available is 12 gallons - 10 gallons = 2 gallons.

By using this allocation, Omar can travel a maximum distance of 200 miles in the car and an additional 100 miles on the moped.

Therefore, the maximum number of miles Omar can travel with the available 12 gallons of gas is 200 miles + 100 miles = 300 miles.

The answer is 21