{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n \"HTML-CSS\": {\n preferredFont: \"TeX\",\n availableFonts: [\"STIX\",\"TeX\"],\n linebreaks: { automatic:true },\n EqnChunk: (MathJax.Hub.Browser.isMobile ? 10 : 50)\n },\n ShowMathMenu: false,\n TeX: {\n extensions: [\"color.js\"],\n noUndefined: {\n attributes: {\n mathcolor: \"red\",\n mathbackground: \"#FFEEEE\",\n mathsize: \"90%\"\n }\n },\n Macros: { href: \"{}\" }\n },\n tex2jax: {\n inlineMath: [[\u0027$\u0027,\u0027$\u0027], [\u0027\\\\(\u0027,\u0027\\\\)\u0027]],\n displayMath: [ [\"$$\",\"$$\"], [\"\\\\[\", \"\\\\]\"] ],\n multiline: true,\n processEscapes: true\n },\n menuSettings: {\n context: \"Browser\"\n },\n messageStyle: \"none\"\n });\n \u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" src\u003d\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\"\u003e\u003c/script\u003e\n\u003cp\u003e \nSaif is very clever, highly skilled in mathematics, and loves to solve math problems a lot. He arranged a party for all his friends at his place. He invited \u003cb\u003eN\u003c/b\u003e friends. Now he wants to calculate the total numbers of handshakes by all his \u003cb\u003eN\u003c/b\u003e friend. If any two friends shake hands exactly once. Can you write a program for saif to count the total number of handshakes?\n\u003c/p\u003e\n\n\u003ch3\u003eInput\u003c/h3\u003e\n\u003cp\u003e \n\nThe first line contains an integer \u003cb\u003eT\u003c/b\u003e, total number of test cases. Then follow \u003cb\u003eT\u003c/b\u003e line, each line contains single integer \u003cb\u003eN\u003c/b\u003e, saif\u0027s friends count. \n\u003c/p\u003e\n\n\u003ch3\u003eOutput\u003c/h3\u003e\n\u003cp\u003ePrint single line output for each test case, total number of handshakes.\u003c/p\u003e\n\n\u003ch3\u003eConstraints\u003c/h3\u003e\n\u003cul\u003e\n\u003cli\u003e1 \u003cb\u003e≤\u003c/b\u003e \u003cb\u003eT\u003c/b\u003e \u003cb\u003e≤\u003c/b\u003e 10^2\u003c/li\u003e\n\u003cli\u003e1 \u003cb\u003e≤\u003c/b\u003e \u003cb\u003eN\u003c/b\u003e \u003cb\u003e\u003c\u003c/b\u003e 10^6\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cpre\u003e\n\u003cb\u003eSample input\u003c/b\u003e\n2 \n5\n123\n\u003cb\u003eSample output\u003c/b\u003e\n10\n7503\n\n\u003c/pre\u003e\u003caside style\u003d\u0027background: #f8f8f8;padding: 10px 15px;\u0027\u003e\u003cdiv\u003e\u003c/div\u003e\u003c/aside\u003e"}}]}