All submissions for this problem are available.
Chef is playing with 'n' set of planes. He notices that when two planes intersects a line is formed.
Being that curious guy that chef already is, he wonders as to how many maximum possible line intersections can he obtain with his n set of planes.
Given n set of planes find the maximum number of line intersections that can be seen via the intersections of n planes.
- The first line contains the number of test cases, t
- The t lines that follow contain a number n denoting the number of planes
For each of the t test cases print the result
- 1 <= t <= 10^5
- 1 <= n <= 10^9
Input: 2 2 3 Output: 1 3
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions