Hint 1
It's tempting to think that the answer is to pay each man a coin for each day he worked, resulting in a total of five coins for A and four coins for B. But then that wouldn't be much of a puzzle, would it?
Remember, the original agreement was that each man would do an equal share of the work.

