{"problem":{"name":"Zero-Sum Ranges 2","description":{"content":"How many different sequences of length $2N$, $A = (A_1, A_2, \\dots, A_{2N})$, satisfy both of the following conditions? *   The sequence $A$ contains $N$ occurrences of $+1$ and $N$ occurrences of $-","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":5000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc117_e"},"statements":[{"statement_type":"Markdown","content":"How many different sequences of length $2N$, $A = (A_1, A_2, \\dots, A_{2N})$, satisfy both of the following conditions?\n\n*   The sequence $A$ contains $N$ occurrences of $+1$ and $N$ occurrences of $-1$.\n*   There are exactly $K$ pairs of $l$ and $r$ $(1 \\leq l \\leq r \\leq 2N)$ such that $A_l + A_{l+1} + \\cdots + A_r = 0$.\n\n## Constraints\n\n*   $1 \\leq N \\leq 30$\n*   $1 \\leq K \\leq N^2$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $K$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc117_e","tags":[],"sample_group":[["1 1","2\n\nFor $N = 1, K = 1$, two sequences below satisfy the conditions:\n\n*   $A = (+1, -1)$\n*   $A = (-1, +1)$"],["2 3","2\n\nFor $N = 2, K = 3$, two sequences below satisfy the conditions:\n\n*   $A = (+1, -1, -1, +1)$\n*   $A = (-1, +1, +1, -1)$"],["3 7","6\n\nFor $N = 3, K = 7$, six sequences below satisfy the conditions:\n\n*   $A = (+1, -1, +1, -1, -1, +1)$\n*   $A = (+1, -1, -1, +1, +1, -1)$\n*   $A = (+1, -1, -1, +1, -1, +1)$\n*   $A = (-1, +1, +1, -1, +1, -1)$\n*   $A = (-1, +1, +1, -1, -1, +1)$\n*   $A = (-1, +1, -1, +1, +1, -1)$"],["8 24","568"],["30 230","761128315856702"],["25 455","0\n\nFor $N = 25, K = 455$, no sequences satisfy the conditions."]],"created_at":"2026-03-03 11:01:14"}}