The end of the first semester is rapidly approaching! Ayman, who has been slacking off all semester, realizes he needs to lock in immediately. His main area of concern is AP English, and his goal is to obtain at least an overall average.
Ayman's teacher is a bit strange - she grades all assignments out of , and does not give extra credit. Furthermore, all assignments are worth the same amount. Ayman has one last assignment to complete before grades are finalized. Given his current average, determine the minimum integral score he must earn in order to end with a final grade of or higher.
If it is impossible for him to achieve this goal (poor him!), print -1
.
Input Specification
The first line will contain Ayman's current average, an integer from to .
The second line will contain the number of assignments he has currently completed, an integer from to .
Output Specification
Print the minimum integer score he must obtain to get at least an overall average.
Sample Input 1
79
2
Sample Output 1
82
Explanation for Sample 1
If Ayman earns a , his average will become .
Sample Input 2
30
3
Sample Output 2
-1
Explanation for Sample 2
It can be proven that Ayman cannot obtain any score that will get him to .
Sample Input 3
99
103
Sample Output 3
0
Explanation for Sample 3
Ayman can flunk the last assignment and still obtain an average.
Comments