## Task 3 - 170913

Mr. $A$ bought several identical books in a bookstore. He would have had to pay an integer amount in marks for each of these books, which was exactly as large as the number of books he bought. However, due to his bulk purchase, he received a one-mark discount on each book.

When he wanted to pay, he found that he only had 10-mark bills with him; he had enough to cover the cost, but the total price was not a whole multiple of 10 marks. The seller could not give him change.

Mr. $B$, an acquaintance of Mr. $A$, was also in the bookstore at the same time. He had also bought some (different) identical books, and the price of each individual book was exactly as many marks as the number of books he bought. He did not receive any discount.

Since their combined bills amounted to a sum that could be paid entirely with 10-mark bills, Mr. $A$ paid the part of Mr. $B$'s bill that was still missing after Mr. $B$ had paid as much of his bill as possible with 10-mark bills.

How many marks did Mr. $A$ pay for Mr. $B$?