Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstdlib>
- #define long long long
- #define nln '\n'
- using namespace std;
- int main()
- {
- //freopen("triang_coin.inp", "r", stdin);
- long T;
- cin >> T;
- for (long t = 1; t <= T; ++t)
- {
- long n;
- cin >> n;
- long i = 1;
- while (n >= 0)
- {
- n -= i;
- ++i;
- }
- cout << i-2 << nln;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment