{"problem":{"name":"Sum Difference","description":{"content":"We have an integer sequence $A$ of length $N$, where $A_1 = X, A_{i+1} = A_i + D (1 \\leq i < N )$ holds. Takahashi will take some (possibly all or none) of the elements in this sequence, and Aoki will","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc147_f"},"statements":[{"statement_type":"Markdown","content":"We have an integer sequence $A$ of length $N$, where $A_1 = X, A_{i+1} = A_i + D (1 \\leq i < N )$ holds.\nTakahashi will take some (possibly all or none) of the elements in this sequence, and Aoki will take all of the others.\nLet $S$ and $T$ be the sum of the numbers taken by Takahashi and Aoki, respectively. How many possible values of $S - T$ are there?\n\n## Constraints\n\n*   $-10^8 \\leq X, D \\leq 10^8$\n*   $1 \\leq N \\leq 2 \\times 10^5$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $X$ $D$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc147_f","tags":[],"sample_group":[["3 4 2","8\n\n$A$ is $(4, 6, 8)$.\nThere are eight ways for (Takahashi, Aoki) to take the elements: $((), (4, 6, 8)), ((4), (6, 8)), ((6), (4, 8)), ((8), (4, 6))), ((4, 6), (8))), ((4, 8), (6))), ((6, 8), (4)))$, and $((4, 6, 8), ())$.\nThe values of $S - T$ in these ways are $-18, -10, -6, -2, 2, 6, 10$, and $18$, respectively, so there are eight possible values of $S - T$."],["2 3 -3","2\n\n$A$ is $(3, 0)$. There are two possible values of $S - T$: $-3$ and $3$."],["100 14 20","49805"]],"created_at":"2026-03-03 11:01:14"}}