After the third purchase, I have only $4.50 left. Can I buy the fourth item for $4.5, if the least price to get the discount is $5?

Let me tell you my approach without using a pen (mental calculation).

So you got 12 dollars to spend. The items are to be of at least 5 dollars and we need to maximize the number of items we can buy with 12 dollars (assume that there is no discount) the maximum number of items you can buy is 2 (you got 1 item for 5$, 2nd item for 5$ - you don’t care about the balance.). If this price is halved, the items will ofcourse double. (1 item for 2.5$. 2nd item for 2.5$, 3rd for 2.5$ and 4th for 2.5$ - again we don’t care about the balance which here are 2 dollars.) The max you can buy is 4 items. Now the price of the 4th item can be 4.5$ but that won’t change the fact you can’t reduce the number of items which again if you read, need to maximize.

Hope it helps.