#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <map>
#include <set>
#include <cmath>

using namespace std;

int main()
{
    int t;
    cin >> t;
    for(int i = 0;i < t;++i)
    {
        int n;
        cin >> n;
        int res = 0;
        int ans = 0;
        for(int j = 1;j <= n;++j)
        {
            if(res+j <= n)
            {
                res+=j;
                ans++;
                if(res == n)
                    break;
            }
            else
            {
                if(res+j-n == 1)
                    ans++;
                ans++;
                break;
            }

        }
        cout << ans << "\n";
    }
    return 0;
}
