101430: [AtCoder]ABC143 A - Curtain

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $100$ points

Problem Statement

The window of Takahashi's room has a width of $A$. There are two curtains hung over the window, each of which has a horizontal length of $B$. (Vertically, the curtains are long enough to cover the whole window.)

We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.

Constraints

  • $1 \leq A \leq 100$
  • $1 \leq B \leq 100$
  • $A$ and $B$ are integers.

Input

Input is given from Standard Input in the following format:

$A$ $B$

Output

Print the total horizontal length of the uncovered parts of the window.


Sample Input 1

12 4

Sample Output 1

4

We have a window with a horizontal length of $12$, and two curtains, each of length $4$, that cover both ends of the window, for example. The uncovered part has a horizontal length of $4$.


Sample Input 2

20 15

Sample Output 2

0

If the window is completely covered, print $0$.


Sample Input 3

20 30

Sample Output 3

0

Each curtain may be longer than the window.

Input

题意翻译

高桥君家的窗户的横向长度是 $A$,安装了 $2$ 张横向长度为 $B$ 的窗帘。(窗帘在垂直方向上足够长,足以覆盖窗户。) 拉上窗帘,使没有被窗帘遮住的窗户的横向长度最小。此时,请计算窗帘未遮盖部分的总横向长度。

加入题单

上一题 下一题 算法标签: