Result:
- A: 21
- B: 5822900
- C: 5689354
- D: 5028010
- E: 5061477
- F: 5318970
Greedy algorithm
- Load the dataset.
- Calculate the score possible for each library (e.g. if sign-in start at current position)
- Reverse sort by: Score / DaysToSign
- Select the first library, and remove from libraries list.
- Remove all the books scanned from all other libraries.
- Move the current sign-in position start.
- If any library left, and there are days left - Goto 2.