P16781 ⌈Xzy OI R1 T3⌋ Piercing Pascal Table

Description

Ciyaqiu has a Pascal’s triangle placed in the fourth quadrant of the Cartesian coordinate system. Inside the triangle, $\binom{i}{j}$ is placed at the coordinate $(j,-i)$, as shown in the figure: ![](https://cdn.luogu.com.cn/upload/image_hosting/e7yxfbcn.png) Ciyaqiu has two non-negative integers $k,b$. He wants to use the line $y=kx-b$ to pass through this Pascal’s triangle. Please tell him the result of the sum of all numbers on this line modulo $1145141$. $1145141$ is a prime number, and Ciyaqiu does not know why he has to use it.

Input Format

One line with two non-negative integers $k,b$.

Output Format

One line with one non-negative integer representing the answer.

Explanation/Hint

**【Constraints】** **This problem uses bundled testdata, meaning you must pass all test points in a subtask to obtain the score for that subtask.** ::cute-table{tuack} | Subtask | Score | $0 \le k \le $ | $0 \le b \le $ | |:-:|:-:|:-:|:-:| | $1$ | $10$ | $0$ | $2 \times 10 ^9$ | | $2$ | $20$ | $1$ | ^ | | $3$ | $20$ | $100$ | ^ | | $4$ | $50$ | $2 \times 10^9$ | ^ | Translated by ChatGPT 5