ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules

[Online] ICPC Ural Regional Contest Qualifier 2026

About     Problems     Submit solution     Judge status     Standings
Contest is over

A. Perfect Sandwich

Time limit: 0.5 second
Memory limit: 256 MB
Vadim prepared N perfect sandwiches, and M guests came to him, and all of them were hungry, and all are ready to eat any number of sandwiches (even zero) that Vadim gives them. To avoid upsetting anyone, each guest must be given the same number of sandwiches, and this number should be as large as possible, while the remaining sandwiches will have to be thrown away.
It is known that one perfect sandwich weighs 80 grams, and the crumbs left after eating one sandwich weigh 2 grams (of course, after each guest they also have to be thrown away). How many grams will Vadim have to throw away?

Input

The first line contains an integer N — the number of prepared perfect sandwiches (1 ≤ N ≤ 109).
The second line contains an integer M — the number of guests who came (1 ≤ M ≤ 109).

Output

Print the number of grams that Vadim will have to throw away.

Samples

inputoutput
5
4
88
6
2
12
Problem Author: Vadim Barinov
Problem Source: The 2026 ICPC Ural Qualification