The Book Worm Challenge
All submissions for this problem are available.
Joey has recently opened an online book selling site where he hands out e-books to his customers in exchange of money. But as Joey has recently opened his site so he could afford only m different books i.e a single copy of each book. Now n customers come and place their order in Joey’s site. Considering that each customer places an order for all the books and since there is so much rush in buying these books each customer places a price(above the normal rate)of his/her own choice at which he/she wants to buy the book. Help Joey in finding an optimal assignment of customer to book that will yield maximum profit.
The first 2 lines contains m and n respectively.
The next m lines contains cost price of each book.
The next m*n lines contains the buying price of each book as placed by each of the n customers.
There will be a single line containing the output of the program.
- 1 <= (m,n)< = 10
Input: 3 3 10 20 30 17 25 36 18 24 37 19 26 34 Output: 21
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.5, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.