Question
IPL Qualification
An IPL team needs a minimum of X more points to qualify for playoffs in their remaining Y matches. A win, tie and loss in a match will yield 2,1,0 points respectively to a team.
You want to find the minimum number of matches that IPL team needs to win to qualify for playoffs. It is guaranteed that team will qualify for playoffs if they win all their remaining Y matches.
Input
The only line of input contains two space-separated integers X, Y.
Constraints:
1 ≤ X, Y ≤ 100
1 ≤ X ≤ 2*Y
Constraints:
1 ≤ X, Y ≤ 100
1 ≤ X ≤ 2*Y
Output
Print the minimum number of matches IPL team must win to qualify for playoffs.
Example
Sample Input:
10 5
Sample Output:
5
Explanation
IPL team needs 10 points from remaining 5 matches to qualify for playoffs. It is only possible if they win all their remaining 5 matches.
10 5
Sample Output:
5
Explanation
IPL team needs 10 points from remaining 5 matches to qualify for playoffs. It is only possible if they win all their remaining 5 matches.