E
E
elnurgoo2014-06-27 22:57:26
Algorithms
elnurgoo, 2014-06-27 22:57:26

Olympiad problem in programming. Can you suggest an algorithm?

The boy wants to sell a thing in the market to one seller.
The seller will definitely accept the price p if it is not more than a certain threshold a, but for the price p higher than he intended, the seller will think. The higher the price, the lower the probability it will accept. Exactly, the probability that he accepts the price p>a if 1 / (1 + (p - a) b), where b>1 is a positive constant in his model.
The boy first bids (a non-negative integer), then the seller decides whether to accept. If he accepts, the trade is over. If he does not accept, the boy offers another price and so on. The boy knows that the salesman would get angry if he always offered unacceptable high prices, so the boy promised that the nth offer (if any) was never more than what he could accept for sure.
We need to find such p in order to maximize the final price.
nab
input
1 10 2
output
10
input
10 33 3.14
output
34.41
Tried the bisector method but can't think of it

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2014-06-27
@jcmvbkbc

@elnurgoo are you kidding me? Nothing is clear.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question