Problem Statement | |||||||||||||
You want to buy a certain set of items. The shop offers you a discount percent discount on every third item you buy. Therefore, you want to purchase the items in an order that will minimize the total cost. Given a int[] prices containing the prices of the desired items and an int discount, return the minimal amount of money you must have in order to buy all the items. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Notes | |||||||||||||
| - | Your return value must have an absolute or relative error less than 1e-9. | ||||||||||||
Constraints | |||||||||||||
| - | discount will be between 0 and 100, inclusive. | ||||||||||||
| - | prices will contain between 0 and 50 elements, inclusive. | ||||||||||||
| - | Each element of prices will be between 0 and 2147483647, inclusive. | ||||||||||||
Examples | |||||||||||||
| 0) | |||||||||||||
| |||||||||||||
| 1) | |||||||||||||
| |||||||||||||
| 2) | |||||||||||||
| |||||||||||||
| 3) | |||||||||||||
| |||||||||||||
| 4) | |||||||||||||
| |||||||||||||
| 5) | |||||||||||||
| |||||||||||||
| 6) | |||||||||||||
| |||||||||||||