fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. long long tests, n;
  8.  
  9. cin >> tests;
  10.  
  11. while (tests--)
  12. {
  13. cin >> n;
  14.  
  15. cout << (int)ceil( (sqrt(8 * n + 1) - 1) / 2 ) << "\n";
  16. }
  17. }
Success #stdin #stdout 0s 5520KB
stdin
3
3
6
4
stdout
2
3
3