//
// Created by LeeChanYoung on 2020/11/30.
//

#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <queue>

#define pii pair<int, int>
#define ll long long
#define Int_MAX 1e9
#define LL_MAX 3e18

using namespace std;

int ans[1005555];

int main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif

    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int t; cin>>t;

    int i,id;
    for(i=1,id=0;;i++)
    {
        id+=i;
        ans[id]=i;
        if (id-1>0) ans[id-1]=i+1;
        if (id-2>0) ans[id-2]=i;
        if (id>=1000405) break;
    }
    ans[1]=1;

    for(i=1000405;i>=1;i--) if (!ans[i]) ans[i]=ans[i+1];

    while(t--)
    {
        int n; cin>>n;
        cout<<ans[n]<<'\n';
    }

    return 0;
}