{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C x D are such that a + b + c + d \u003d 0 . In the following, we assume that all lists have the same size n . "}},{"title":"Input","value":{"format":"HTML","content":"The first line of the input file contains the size of the lists n (this value can be as large as 4000). We then have n lines containing four integer values (with absolute value as large as 2\u003csup\u003e28\u003c/sup\u003e ) that belong respectively to A, B, C and D . "}},{"title":"Output","value":{"format":"HTML","content":"For each input file, your program has to write the number quadruplets whose sum is zero. "}},{"title":"Sample","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\n-45 22 42 -16\r\n-41 -27 56 30\r\n-36 53 -37 77\r\n-36 30 -75 -46\r\n26 -38 -10 62\r\n-32 -54 -6 45\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e5\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"Sample Explanation: Indeed, the sum of the five following quadruplets is zero: (-45, -27, 42, 30), (26, 30, -10, -46), (-32, 22, 56, -46),(-32, 30, -75, 77), (-32, -54, 56, 30). "}}]}