{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n I have 4 multisets A, B, C, D of integer values. All the multisets have the same size n.\u003cbr /\u003e\n Please help me count how many quadruples (a, b, c, d ) are satisfied with the sum of a, b, c and d is equal to zero. Please note that (a, b, c, d ) ∈ A × B × C × D and × means cartesian product. \n \u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n The first line contains the size of the multisets n ( n \u0026lt;\u003d 4000 ).\u003cbr /\u003e\n The next n lines contain four integer a\u003csub\u003ei\u003c/sub\u003e, b\u003csub\u003ei\u003c/sub\u003e, c\u003csub\u003ei\u003c/sub\u003e and d\u003csub\u003ei\u003c/sub\u003e ( -2\u003csup\u003e28\u003c/sup\u003e \u0026lt;\u003d a\u003csub\u003ei\u003c/sub\u003e, b\u003csub\u003ei\u003c/sub\u003e, c\u003csub\u003ei\u003c/sub\u003e, d\u003csub\u003ei\u003c/sub\u003e \u0026lt;\u003d 2\u003csup\u003e28\u003c/sup\u003e ) that belong respectively to A, B, C and D . \n \u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n Output the number quadruples which sum is 0. \n \u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e3\n1 -1 2 -2\n5 6 7 8\n1 4 -6 -5\n\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e3\n\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cpre\u003e\n(1, -1, 2, -2),\n(5, 6, -6, -5),\n(1, -1, 2, -2).\n\u003c/pre\u003e"}}]}