{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n #problem-body \u003e 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","sections":[{"title":"","value":{"format":"HTML","content":"\u003cscript\u003e\n\tsetTimeout(function(){\n\t\trenderMathInElement(document.body, {delimiters: [{left: \u0027$$\u0027, right: \u0027$$\u0027, display: true}, {left: \u0027$\u0027, right: \u0027$\u0027, display: false}, {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false}]});\n\t}, 1000);\n\u003c/script\u003e\n\u003cdiv id\u003d\"problem-body\"\u003e \n \u003cp\u003e Once in C Programming class Dennis Ritchie told his students to define an array Arr[0….n-1] of n positive integer numbers, and no integer will be repeated. He also added that if x \u003c y and Arr[y] \u003c Arr[x], then the pair (x,y) will be called a lucky pair. Your task is to find the lucky pairs.\n\n \u003c/p\u003e \n \u003ch3\u003eInput\u003c/h3\u003e \n \u003cp\u003eThe 1st line will contain n, the number of test cases followed by a blank space. Each of the n tests will start with a number m, where m defines the size of array (m \u003c\u003d 200000). Then m + 1 lines follow. In the x th line a number A[x - 1] is given (A[x - 1] \u003c\u003d 10^7). The (m + 1)th line is a blank space.\n\u003c/p\u003e \n \u003ch3\u003eOutput\u003c/h3\u003e \n \u003cp\u003eFor every test output one line giving the number of lucky pairs of Arr.\n\u003c/p\u003e \n \u003ch3\u003eExample\u003c/h3\u003e \n \u003cpre\u003e\u003cstrong\u003eInput:\u003c/strong\u003e\n2\n\n3\n3\n1\n2\n\n5\n2\n3\n8\n6\n1\n\n\n\u003cstrong\u003eOutput:\u003c/strong\u003e\n2\n5\u003c/pre\u003e \n\u003c/div\u003e"}}]}