@@ -0,0 +1,1787 @@
+/**%0A * Created by Eric on 16/9/13.%0A */%0A/*To try and encourage more sales of the 5 different Harry%0APotter books they sell, a bookshop has decided to offer%0Adiscounts of multiple-book purchases.%0A%0AOne copy of any of the five books costs 8 EUR.%0A%0AIf, however, you buy two different books, you get a 5%25%0Adiscount on those two books.%0A%0AIf you buy 3 different books, you get a 10%25 discount.%0A%0AIf you buy 4 different books, you get a 20%25 discount.%0A%0AIf you go the whole hog, and buy all 5, you get a huge 25%25%0Adiscount.%0A%0ANote that if you buy, say, four books, of which 3 are%0Adifferent titles, you get a 10%25 discount on the 3 that%0Aform part of a set, but the fourth book still costs 8 EUR.%0A%0AYour mission is to write a piece of code to calculate the%0Aprice of any conceivable shopping basket (containing only%0AHarry Potter books), giving as big a discount as possible.%0A%0AFor example, how much does this basket of books cost?%0A%0A2 copies of the first book%0A2 copies of the second book%0A2 copies of the third book%0A1 copy of the fourth book%0A1 copy of the fifth book%0A%0AOne way of group these 8 books is:%0A 1 group of 5 --%3E 25%25 discount (1st,2nd,3rd,4th,5th)%0A+1 group of 3 --%3E 10%25 discount (1st,2nd,3rd)%0AThis would give a total of%0A 5 books at a 25%25 discount%0A+3 books at a 10%25 discount%0AGiving%0A 5 x (8 - 2.00) == 5 x 6.00 == 30.00%0A+3 x (8 - 0.80) == 3 x 7.20 == 21.60%0AFor a total of 51.60%0A%0AHowever, a different way to group these 8 books is:%0A 1 group of 4 books --%3E 20%25 discount  (1st,2nd,3rd,4th)%0A+1 group of 4 books --%3E 20%25 discount  (1st,2nd,3rd,5th)%0AThis would give a total of%0A 4 books at a 20%25 discount%0A+4 books at a 20%25 discount%0AGiving%0A 4 x (8-1.60) == 4 x 6.40 == 25.60%0A+4 x (8-1.60) == 4 x 6.40 == 25.60%0AFor a total of 51.20%0A%0AAnd 51.20 is the price with the biggest discount.%0A*/%0Apublic class TestHarryPotter %7B%0A%7D%0A

add kata description