AMRALAA - Amr and Math
One day Amr Alaa was solving an E Div1 problem on Codeforces, when suddenly Kareem called him and said “El7a2 yad nateeget el math zaharet O.O”, he immediately logged into the e-com to check his grade, and he was shocked !! He got an F!! .. As a result, he was kicked out from his home by his parents who were very angry at him. And he had no place to stay in. He asked Kareem what can he do with this problem?! So, Kareem suggested that he would build his own house. Unfortunately, Alaa didn’t have enough money to do that. So, he asked Shokry to lend him some money. Shokry was generous, and lent him a sufficient amount of money. Alaa began building his own new house, starting with putting N bricks on the first day, and on the i-th day, he puts (N - i) bricks, until the number (N - i) is no longer positive.
Eventually, he had his own new house built, but now he wants to give back to Shokry the money he borrowed, given that one brick costs 3 L.E.
How much did Shokry lend Alaa?
The first line contains a number T – the number of test cases (1 <= T <= 1000), and T lines follow. The i-th line contains one positive integer Ni (1 <= Ni <= 105) – the number of bricks on the first day.
For each test case, print a single number, the answer to the problem.
1 Output: 18