Time limit
1s
Memory limit
128 MB
Sunyoung has prepared N identical sausages for M food critics. She wants to cut the sausages so that every critic receives exactly the same total amount of sausage.
Find the minimum number of cuts required.
The first line contains two integers N and M, the number of sausages and the number of critics.
Print the minimum number of cuts needed so that all critics can receive the same amount.