#include <bits/stdc++.h>

using namespace std;

#define mod 1000000007 
#define set(n) cout << fixed << setprecision(n)    
#define fi first
#define se second
#define mp make_pair
#define pll pair<lli, lli>
#define endl '\n'

const double PI = acos(-1);
const double epsilon = 1e-7;  // floating point precision

typedef long long int lli;
typedef long double ld;

signed main(void) {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int tt;
    cin >> tt;
    vector<int> pref;
    int sum = 0;
    const int MAX = (int) 1e9;
    for(int i = 0; sum < MAX; i++) {
        sum += i;
        pref.push_back(sum);
    }
    while(tt --> 0) {
        int x;
        cin >> x;
        int l, r;
        l = lower_bound(pref.begin(), pref.end(), x) - pref.begin();
        r = upper_bound(pref.begin(), pref.end(), x) - pref.begin();
        if(binary_search(pref.begin(), pref.end(), x)) {
            r = l;
        }
        else {
            l = l - 1;
        }
        if(x == pref[l]) {
            cout << l << endl;
        }
        else if(x == pref[r] - 1) {
            cout << r + 1 << endl;
        }
        else {
            cout << r << endl;
        }
    }
}
