CSES - Triangle Number Sums
  • Time limit: 1.00 s
  • Memory limit: 512 MB

A triangle number is a positive integer of the form 1+2++k1+2+\dots+k. The first triangle numbers are 11, 33, 66, 1010 and 1515.

Every positive integer can be represented as a sum of triangle numbers. For example, 42=21+2142=21+21 and 1337=1326+10+11337=1326+10+1.

Given a positive integer nn, determine the smallest number of triangle numbers that sum to nn.

Input

The first line has an integer tt: the number of tests.

After that, each line has a positive integer nn.

Output

For each test, print the smallest number of triangle numbers.

Constraints

  • 1t1001 \le t \le 100
  • 1n10121 \le n \le 10^{12}

Example

Input:

5
1
2
3
42
1337

Output:

1
2
1
2
3