Under construction

Still being built. Things may change

Pizza Grows as You Slice It

Time limit1sMemory limit256 MB

Summary
For each K, choose the number of cuts that maximizes the pieces kept after giving away 1+2+...+k pieces to Yunhee.
Level

Hard8 of 10

Topics
Math, Combinatorics, Geometry
Solved
No attempts yet

Problem

Yechan, on a diet for the new semester, is having a hard time. Too hungry from the diet, he decides to order a pizza. Wanting to savor the pizza for a long time, he plans to cut it into pieces with kk cuts (1≤k≤K1 \le k \le K) and then enjoy the pieces one by one. But only after the long-awaited pizza arrives does he realize that he has no knife. His friend Yunhee, who happens to have a knife, makes him this offer.

"I'll let you use my knife! But after you finish cutting the pizza, you give me one more piece for each cut. In other words, for 1 cut you give me 1 piece, for 2 cuts you add 2 more pieces for 3 pieces total, and for 3 cuts you add 3 more pieces for 6 pieces total."

Yechan, already on a diet, thinks Yunhee's offer is not bad and accepts it. But since he wants to savor the pizza for as long as possible, he wants to maximize the number of pizza pieces he eats. The size of the pieces does not matter, and each cut must be a straight line. Given the maximum number of cuts KK, find the maximum number of pizza pieces Yechan can eat!

Input

The first line gives the number of test cases NN as an integer. (1≤N≤10001 \le N \le 1000)

The next NN lines give the test cases, one per line, and each test case gives the maximum number of cuts KK as an integer. (1≤K≤1091 \le K \le 10^9)

Output

For each test case, print the maximum number of pizza pieces Yechan can eat.

Examples1

  1. Example 1

    Input
    2
    1
    2
    
    Expected output
    1
    1