You can set up the proportion

cost/y = b/x

Solve for cost

cost = by/x

cost/y = b/x

Solve for cost

cost = by/x

Didn't find the answer you were looking for?