title: Calculating bid price from total cost
body: <p>I have to following problem to solve. I have to calculate the bidding price from a total price. For example, a client wants to pay 2000$ as a total price, but from this price, there are added costs: </p>
  
  <p>-usage price which is 10% from the bidding price with a minimum of 10$ and a maximum of 50$</p>
  
  <p>-seller price: 2% from bidding price</p>
  
  <p>-added price: 5$ for a bid between 1 and 500
                10$ for a bid between 501 and 1000
                15$ for a bid between 1001 and 3000
                20$ for a bid over 3000$</p>
  
  <p>-storing cost: 100$</p>
  
  <p>from all this, I have to calculate the bidding price for a total of 2000$, for example. I kind of have no clue of how this can be done. Can anyone give me some hints or pieces of answer of what the algorithm should be?</p>
  
  <p>EDIT: ok I got how to calculate the algebra, now where i'm stuck is how to write the algorithm in code or pseudo-code. Anyone got a hint?</p>