405558: GYM101992 F MO Salah running down the wing
Description
The ECPC judges were discussing Salah's performance this season. Some of them think that it is lower than his level in the last season, but others think that it is too early to judge him. They all agreed that if he ended this season with the same average number of goals as the last season, then there is no need to worry.
Given four integers, $$$N$$$, $$$M$$$, $$$X$$$ and $$$Y$$$ representing his average number of goals per match in the last season, the number of goals he scored so far in the current season, the number of matches that were already played and the number of remaining matches respectively.
What is the minimum number of goals he needs to score in the remaining matches to have at least the same average number of goals as the last season ?
InputThe first line of the input is the number of test cases $$$T$$$. Each test case consists of four integers $$$N$$$, $$$M$$$, $$$X$$$, and $$$Y$$$, where $$$0 \leq N, M, X, Y \leq 100$$$ and $$$X + Y > 0$$$.
OutputFor each test case output a single line containing the minimum number of goals or $$$-1$$$ if Salah can't make it.
ExampleInput4Output
1 1 37 1
5 1 1 37
1 0 1 0
2 6 1 2
37
189
-1
0