{"raw_statement":[{"iden":"problem statement","content":"Given are integers $N$ and $K$. How many quadruples of integers $(a,b,c,d)$ satisfy both of the following conditions?\n\n*   $1 \\leq a,b,c,d \\leq N$\n*   $a+b-c-d=K$"},{"iden":"constraints","content":"*   $1 \\leq N \\leq 10^5$\n*   $-2(N-1) \\leq K \\leq 2(N-1)$\n*   All numbers in input are integers."},{"iden":"input","content":"Input is given from standard input in the following format:\n\n$N$ $K$"},{"iden":"sample input 1","content":"2 1"},{"iden":"sample output 1","content":"4\n\nFour quadruples below satisfy the conditions:\n\n*   $(a,b,c,d)=(2,1,1,1)$\n*   $(a,b,c,d)=(1,2,1,1)$\n*   $(a,b,c,d)=(2,2,2,1)$\n*   $(a,b,c,d)=(2,2,1,2)$"},{"iden":"sample input 2","content":"2525 -425"},{"iden":"sample output 2","content":"10314607400"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}