CF1580F Problems for Codeforces

Description

XYMXYM and CQXYM will prepare $ n $ problems for Codeforces. The difficulty of the problem $ i $ will be an integer $ a_i $ , where $ a_i \geq 0 $ . The difficulty of the problems must satisfy $ a_i+a_{i+1}

Input Format

A single line contains two integers $ n $ and $ m $ ( $ 2 \leq n \leq 50\,000 $ , $ 1 \leq m \leq 10^9 $ ).

Output Format

Print a single integer — the number of different plans.

Explanation/Hint

In the first test case, the valid $ a $ are: $ [0,0,0] $ , $ [0,0,1] $ , $ [0,1,0] $ , $ [1,0,0] $ . $ [1,0,1] $ is invalid since $ a_1+a_n \geq m $ .