# A question on intercepts and coefficients in linear regression

So I was studying through some sites and saw a Linear regression problem where a company is attempting to find the correct amount to spend on marketing. The example had a small dataset with units sold and total expenditure historically. The example then shows a function with 3 variables: historic expenditure (list), units sold (list) and the desired number of units they wish to sell. The training data used the historic expense as the independent variable and the units sold as our dependent variable, which was fit with the LinearRegression model. In their example, the answer boiled down to (desired units sold - model.intercept_)/ model.coef_

so conceptually, I understand the intercept as the constant with the predictor variable @ 0, so it makes sense to subtract the constant value from our value with which we wish to predict on (our desired output of units sold) but I'm having a hard time understanding why we choose to divide that value by the model coefficients? I don't fully understand what the coefficients really mean (weights or something?). Any explanation with math would be helpful.

Since historic expense $$E$$ is an independent variable and unit sold $$S$$ is a dependent variable, the model should be like this
$$S = m \times E + c$$
where $$m$$ should be the model.coef_, and $$c$$ should be the model.intercept_.
So if you want to work back the $$E$$ based on a target $$S$$ given the model, you will do
$$\frac{S - c}{m}$$