Problem:
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.

Solution in Rust (1.15.1) (judge verdict: Accepted)

// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8

macro_rules! input {
    (source = $s:expr; $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        #[allow(unused_mut)]
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };

    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
#[allow(unused_imports)]
use std::cmp::*;
trait Each: Iterator {
    fn each<F>(self, mut f: F)
    where
        Self: Sized,
        F: FnMut(Self::Item),
    {
        self.fold((), move |(), item| f(item));
    }
}
impl<T: Iterator> Each for T {}

const SEPARATOR: &'static str = " ";

fn solve(source: &str) -> String {
    let mut result: Vec<String> = vec![];
    macro_rules! p {
        ([$x: expr]) => {
            $x.iter().each(|&x| p!(x))
        };
        ([$x: expr]; $s:expr)=>{
            p!($x.iter().map(|x|x.to_string()).collect::<Vec<_>>().join($s));
        };
        ($($x: expr),* $(,)*) => {
            $(result.push($x.to_string()));*
        };
    }
    //---------------------------------------------------------------//

    input! {
        source = source;
        a:u64,
        b:u64,
    }
    if a>2*b{
        p!(a-2*b);

    }else{
        p!(0);
    }

    //---------------------------------------------------------------//
    return result.join(SEPARATOR);
}
fn main() {
    let mut s;
    let source = {
        use std::io::Read;
        s = String::new();
        std::io::stdin().read_to_string(&mut s).unwrap();
        s.as_str()
    };
    println!("{}", solve(source));
}
#[test]
fn testcase() {
    assert_eq!(solve(r"12 4
"),r"4");
assert_eq!(solve(r"20 15
"),r"0");
assert_eq!(solve(r"20 30
"),r"0");
}