{"raw_statement":[{"iden":"problem statement","content":"Takahashi is distributing $N$ balls to $K$ persons.\nIf each person has to receive at least one ball, what is the maximum possible difference in the number of balls received between the person with the most balls and the person with the fewest balls?"},{"iden":"constraints","content":"*   $1 \\leq K \\leq N \\leq 100$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $K$"},{"iden":"sample input 1","content":"3 2"},{"iden":"sample output 1","content":"1\n\nThe only way to distribute three balls to two persons so that each of them receives at least one ball is to give one ball to one person and give two balls to the other person.\nThus, the maximum possible difference in the number of balls received is $1$."},{"iden":"sample input 2","content":"3 1"},{"iden":"sample output 2","content":"0\n\nWe have no choice but to give three balls to the only person, in which case the difference in the number of balls received is $0$."},{"iden":"sample input 3","content":"8 5"},{"iden":"sample output 3","content":"3\n\nFor example, if we give $1, 4, 1, 1, 1$ balls to the five persons, the number of balls received between the person with the most balls and the person with the fewest balls would be $3$, which is the maximum result."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}