Artificial intelligent assistant

How to maximize profit in this equation? A 300 room hotel is filled to capacity at \$80 a night. If the charge is increased by \$3 it rents 9 less rooms. If it costs \$10 to clean a rented room the next day, how much should the inn keeper charge in order to maximize its profit? I thought the question was really straight forward and that I'd be able to do the following to get my answer: Revenue = (# Of Rooms * Room Charge) - (# Of Rooms * Clean Charge) **Full Inn** Revenue = (300 * 80) - (300 * 10) which is 24,000 - 3,000 so Revenue = \$21,000 **Not Full Inn** Revenue = (291 * 83) - (291 * 10) which is 24,153 - 2,910 so Revenue = \$21,243 Therefore the inn keeper should charge \$83 a room. I got the question wrong, so can someone explain what I should have done?

Let us charge $80+x$. Then we rent $300-3x$ rooms.

Net Income, after cleaning: $(80+x)(300-3x) -(10)(300-3x)$.

Do the usual stuff to maximize, not forgetting about endpoints. There is also the complication that the number that maximizes our function will not necessarily lead to an integer number of rooms rented, so we may have to make a mild adjustment.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 8afd06bcbcd645773cf66b996988bf38