Time limit
2s
Memory limit
128 MB
A player has played X games and won Y of them.
The displayed win rate Z is computed as floor(100 * Y / X). In other words, the fractional part is discarded.
From now on, the player will win every additional game. Because the record is cumulative, each future game increases both the total number of games and the number of wins by 1.
Given X and Y, find the minimum number of additional games needed for the displayed integer win rate to increase.
A single line contains two integers X and Y.
Print the minimum number of additional games needed for the displayed win rate to increase. If it can never increase, print -1.
1 <= X <= 1,000,000,0000 <= Y <= X