CUSTOMSL - Customs
Matheus, Bruno and Ricardo are the boasting for the research department at Indústria de Obras Intermináveis (IOI) and they constantly travel together to other countries to research different methods, equipment and raw materials for amazing works. Furthermore, they operate in the informal import market, bringing equipment and electronics for their friends and coworkers.
Before leaving they make a list of N products that they have to buy, each one of them with a price Pi DE$ (Dinheiro Estrangeiro). They have to pay some customs duty if any one of them exceeds the maximum amount of Q that each one can bring.
As them always travel together, they note that it’s cheaper for them, if the products are organized in a way that’s can be possible to reduce the amount of duty they have to pay. Given the prices of N products, Q and the tax A, you have to say the minimum price of duty that they have to pay.
Input
The input is only a test case. The first line include an integer N (1 ≤ N ≤ 100), that represents the number of products bought.
The second line include two integers, Q and A (1 ≤ Q ≤ 500, 1 ≤ A ≤ 200), that represents the maximum amount of import, and the tax of importation in percent.
The next N lines includes each one, an integer Pi (1 ≤ Pi ≤ Q), that represents the price of the i-th product.
Output
You have to write in your output a single line contains the minimum possible value of duty that Matheus, Bruno and Ricardo have to pay.
Example
Input: 4 10 1 10 9 8 7 Output: 0.05
Input: 6 9 20 9 6 3 3 3 3 Output: 0.00
hide comments
|
Adrian Jaskó³ka:
2012-06-04 21:13:02
Time limit is too strict. If you think that your algorithm is ok, but you are getting TL, try remove STL (for example change vectors for arrays). There is also one tricky case where you can answer in O(n), and whitout that case, I got TL. Last edit: 2012-06-04 21:13:42 |
|
Mateus Dantas [ UFCG ]:
2012-03-03 18:07:34
You're getting WA in this test case -> <snip> The correct answer is 0.00 Last edit: 2022-08-30 20:32:36 |
|
Palash Jain:
2012-03-03 16:37:16
getting WA, id=6594721, pl. check.
|
Added by: | Mateus Dantas [ UFCG ] |
Date: | 2012-03-02 |
Time limit: | 1s-3.5s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | Olimpiada Brasileira de Informatica - Seletiva 2007 |