Ok, I would take the total of books each person bought: 9 for one and 5 for the second
Now with that known divide each total amount spent by the total amount of books for each.
What also may need to be determined is if taxes are involved.
Let me know if I was any help or blew it.