# Old yd and Disjoint Sets: Single Inverse Table Contribution: the problem setter supplied terminal-path enumeration. Codex (GPT-6) added rolling weighted binomial coefficients, exact floors, proofs and implementation. Modular inverses and adjacent binomial ratios are classical formulas. This is a parallel option to the [factorial-table solution](solution.en.md), trading additional constant-time work for less space. ## The same count with different coefficient storage Use $t=n-B$ , $L_b,R_b$ and the exact floors proved in the main solution. The term without any $e$ step is $C^{t+1}$ . For $b\ge1$ , its lowest term is $$W(a,b)=\binom{a+b}{a}C^aD^b,\qquad a=L_b.$$ Higher $j\in[L_b+1,R_b]$ contribute $\binom{j+b-1}{j}C^jD^b$ . The terminal conditions and counts are unchanged; only the coefficient computation changes. Precompute $\operatorname{inv}[i]=i^{-1}\bmod p$ for $p=10^9+7$ and $1\le i\le T=\max(n-B+1)$ : $$\operatorname{inv}[1]=1,\qquad\operatorname{inv}[i]=p-\lfloor p/i\rfloor\operatorname{inv}[p\bmod i]\bmod p.$$ Because $i