Problem: Gauss Sum Descr.: Blah blah blah blah blah blah blah. Blah blablah blahblah bla blah. Blah blabla bla bla bla bla blah. Bla bla blah blah. Blah blah blah blah blah blah blah. Blah blablah blahblah bla blah. Blah blabla bla bla bla bla blah. Bla bla blah blah. Blah blah blah blah blah blah blah. Blah blablah blahblah bla blah. Blah blabla bla bla bla bla halb. Bla bla blah blah. Blah blah blah blah blah blah blah. Blah blablah blahblah bla blah. Blah blabla bla bla bla bla blah. Bla bla blah blah. Blah blah blah blah blah blah blah. Blah blablah blahblah bla blah. Blah blabla bla bla bla bla blah. Bla bla blah blah. TL;DR: You are to sum up all positive integers from 1 to a given number n. Input: The first line of input contains a single integer 0 < t <= 100000, the amount of test cases. Then t lines follow each containing a positive integer n. It is guaranteed, that n fits into a signed 32 bit integer. Output: For each test case, print one line containing the sum of all positive integers smaller or equal to n. Sample: Input: Output: 5 1 2 10 11 12 1 3 55 66 78
© Copyright 2024 ExpyDoc