{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Problem Statement","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\r\n\u003cp\u003eYou are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens.\u003c/p\u003e\r\n\u003cp\u003eThere are \u003cvar\u003e\\(N\\)\u003c/var\u003e attendees in the party, and they are given attendee numbers from \u003cvar\u003e\\(1\\)\u003c/var\u003e through \u003cvar\u003e\\(N\\)\u003c/var\u003e. The height of Attendee \u003cvar\u003e\\(i\\)\u003c/var\u003e is \u003cvar\u003e\\(A_i\\)\u003c/var\u003e.\u003c/p\u003e\r\n\u003cp\u003eAccording to an examination beforehand, you know that a pair of attendees satisfying the condition below will make the transaction.\u003c/p\u003e\r\n\u003cul\u003e\r\n\u003cli\u003eThe absolute difference of their attendee numbers is equal to the sum of their heights.\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\u003cp\u003eThere are \u003cvar\u003e\\(\\frac{N(N-1)}{2}\\)\u003c/var\u003e ways to choose two from the \u003cvar\u003e\\(N\\)\u003c/var\u003e attendees and make a pair. Among them, how many satisfy the condition above?\u003c/p\u003e\r\n\u003cp\u003eP.S.: We cannot let you know the secret.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Constraints","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\r\n\u003cul\u003e\r\n\u003cli\u003eAll values in input are integers.\u003c/li\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(2 \\leq N \\leq 2 \\times 10^5\\)\u003c/var\u003e\u003c/li\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(1 \\leq A_i \\leq 10^9\\ (1 \\leq i \\leq N)\\)\u003c/var\u003e\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Input","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\r\n\u003cp\u003eInput is given from Standard Input in the following format:\u003c/p\u003e\r\n\u003cpre\u003e\u003cvar\u003e\\(N\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(A_1\\)\u003c/var\u003e \u003cvar\u003e\\(A_2\\)\u003c/var\u003e \u003cvar\u003e\\(\\dots\\)\u003c/var\u003e \u003cvar\u003e\\(A_N\\)\u003c/var\u003e\r\n\u003c/pre\u003e\r\n\r\n\u003c/section\u003e\r\n"}},{"title":"Output","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\r\n\u003cp\u003ePrint the number of pairs satisfying the condition.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Sample 1","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\u003e6\r\n2 3 3 1 3 1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003cul\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(A_1 + A_4 \u003d 3\\)\u003c/var\u003e, so the pair of Attendee \u003cvar\u003e\\(1\\)\u003c/var\u003e and \u003cvar\u003e\\(4\\)\u003c/var\u003e satisfy the condition.\u003c/li\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(A_2 + A_6 \u003d 4\\)\u003c/var\u003e, so the pair of Attendee \u003cvar\u003e\\(2\\)\u003c/var\u003e and \u003cvar\u003e\\(6\\)\u003c/var\u003e satisfy the condition.\u003c/li\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(A_4 + A_6 \u003d 2\\)\u003c/var\u003e, so the pair of Attendee \u003cvar\u003e\\(4\\)\u003c/var\u003e and \u003cvar\u003e\\(6\\)\u003c/var\u003e satisfy the condition.\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\u003cp\u003eNo other pair satisfies the condition, so you should print \u003cvar\u003e\\(3\\)\u003c/var\u003e.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Sample 2","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\u003e6\r\n5 2 4 2 8 8\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003cp\u003eNo pair satisfies the condition, so you should print \u003cvar\u003e\\(0\\)\u003c/var\u003e.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Sample 3","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\u003e32\r\n3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e22\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n\r\n\u003csection\u003e\r\n\u003c/section\u003e\r\n"}}]}