#P9435. 『XYGOI round1』三个数

『XYGOI round1』三个数

Problem Description

MX has a set S={3,4,5,,w}S=\{3,4,5,\cdots ,w\} containing (w2)(w-2) numbers. You need to construct a set that contains only non-negative integers (with no repeated elements), such that every number in SS can be obtained by adding together at least 33 different numbers from this set. Find the minimum number of elements this set must contain.

Input Format

This problem contains multiple groups of testdata.

The first line contains an integer TT, the number of test cases.

The next TT lines each contain an integer ww.

Output Format

Output TT lines. Each line outputs an integer nn, meaning the minimum number of elements the set should contain.

1
4
4
5
3
18
999
9999
9999999999
3
6
12
15
35

Hint

Sample 1 Explanation:

The set elements can be 0,1,2,30,1,2,3.

Constraints:

This problem uses bundled tests.

For all testdata, it is guaranteed that 1T1051\le T \le 10^5 and 3w10123\le w \le 10^{12}.

Subtask TT ww Score
0 =1=1 w10w\le 10 5
1 1T1031\le T\le 10^3 w20w\le 20 10
2 1T501\le T\le 50 w103w\le 10^{3} 25
3 1T1031\le T\le 10^3 w105w\le 10^{5} 30
4 1T1051\le T\le 10^5 3w10123\le w\le 10^{12}

Translated by ChatGPT 5