{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eTanya has $$$n$$$ candies numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th candy has the weight $$$a_i$$$.\u003c/p\u003e\u003cp\u003eShe plans to eat exactly $$$n-1$$$ candies and give the remaining candy to her dad. Tanya eats candies in order of increasing their numbers, \u003cspan class\u003d\"tex-font-style-bf\"\u003eexactly one candy per day\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eYour task is to find the number of such candies $$$i$$$ (let\u0027s call these candies \u003cspan class\u003d\"tex-font-style-bf\"\u003egood\u003c/span\u003e) that if dad gets the $$$i$$$-th candy then the sum of weights of candies Tanya eats in even days will be equal to the sum of weights of candies Tanya eats in odd days. Note that at first, she will give the candy, after it she will eat the remaining candies one by one.\u003c/p\u003e\u003cp\u003eFor example, $$$n\u003d4$$$ and weights are $$$[1, 4, 3, 3]$$$. Consider all possible cases to give a candy to dad:\u003c/p\u003e\u003cul\u003e \u003cli\u003e Tanya gives the $$$1$$$-st candy to dad ($$$a_1\u003d1$$$), the remaining candies are $$$[4, 3, 3]$$$. She will eat $$$a_2\u003d4$$$ in the first day, $$$a_3\u003d3$$$ in the second day, $$$a_4\u003d3$$$ in the third day. So in odd days she will eat $$$4+3\u003d7$$$ and in even days she will eat $$$3$$$. Since $$$7 \\ne 3$$$ this case shouldn\u0027t be counted to the answer (this candy isn\u0027t \u003cspan class\u003d\"tex-font-style-bf\"\u003egood\u003c/span\u003e). \u003c/li\u003e\u003cli\u003e Tanya gives the $$$2$$$-nd candy to dad ($$$a_2\u003d4$$$), the remaining candies are $$$[1, 3, 3]$$$. She will eat $$$a_1\u003d1$$$ in the first day, $$$a_3\u003d3$$$ in the second day, $$$a_4\u003d3$$$ in the third day. So in odd days she will eat $$$1+3\u003d4$$$ and in even days she will eat $$$3$$$. Since $$$4 \\ne 3$$$ this case shouldn\u0027t be counted to the answer (this candy isn\u0027t \u003cspan class\u003d\"tex-font-style-bf\"\u003egood\u003c/span\u003e). \u003c/li\u003e\u003cli\u003e Tanya gives the $$$3$$$-rd candy to dad ($$$a_3\u003d3$$$), the remaining candies are $$$[1, 4, 3]$$$. She will eat $$$a_1\u003d1$$$ in the first day, $$$a_2\u003d4$$$ in the second day, $$$a_4\u003d3$$$ in the third day. So in odd days she will eat $$$1+3\u003d4$$$ and in even days she will eat $$$4$$$. Since $$$4 \u003d 4$$$ this case \u003cspan class\u003d\"tex-font-style-bf\"\u003eshould be counted\u003c/span\u003e to the answer (this candy is \u003cspan class\u003d\"tex-font-style-bf\"\u003egood\u003c/span\u003e). \u003c/li\u003e\u003cli\u003e Tanya gives the $$$4$$$-th candy to dad ($$$a_4\u003d3$$$), the remaining candies are $$$[1, 4, 3]$$$. She will eat $$$a_1\u003d1$$$ in the first day, $$$a_2\u003d4$$$ in the second day, $$$a_3\u003d3$$$ in the third day. So in odd days she will eat $$$1+3\u003d4$$$ and in even days she will eat $$$4$$$. Since $$$4 \u003d 4$$$ this case \u003cspan class\u003d\"tex-font-style-bf\"\u003eshould be counted\u003c/span\u003e to the answer (this candy is \u003cspan class\u003d\"tex-font-style-bf\"\u003egood\u003c/span\u003e). \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eIn total there $$$2$$$ cases which should counted (these candies are \u003cspan class\u003d\"tex-font-style-bf\"\u003egood\u003c/span\u003e), so the answer is $$$2$$$.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of the input contains one integer $$$n$$$ ($$$1 \\le n \\le 2 \\cdot 10^5$$$) — the number of candies.\u003c/p\u003e\u003cp\u003eThe second line of the input contains $$$n$$$ integers $$$a_1, a_2, \\dots, a_n$$$ ($$$1 \\le a_i \\le 10^4$$$), where $$$a_i$$$ is the weight of the $$$i$$$-th candy.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint one integer — the number of such candies $$$i$$$ (\u003cspan class\u003d\"tex-font-style-bf\"\u003egood\u003c/span\u003e candies) that if dad gets the $$$i$$$-th candy then the sum of weights of candies Tanya eats in even days will be equal to the sum of weights of candies Tanya eats in odd days.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e7\n5 5 4 5 5 5 6\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e8\n4 8 8 7 8 4 4 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e9\n2 3 4 2 2 3 2 2 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first example indices of \u003cspan class\u003d\"tex-font-style-bf\"\u003egood\u003c/span\u003e candies are $$$[1, 2]$$$.\u003c/p\u003e\u003cp\u003eIn the second example indices of \u003cspan class\u003d\"tex-font-style-bf\"\u003egood\u003c/span\u003e candies are $$$[2, 3]$$$.\u003c/p\u003e\u003cp\u003eIn the third example indices of \u003cspan class\u003d\"tex-font-style-bf\"\u003egood\u003c/span\u003e candies are $$$[4, 5, 9]$$$.\u003c/p\u003e"}}]}