출처

  • 2014 Sogang Programming Contest Master A번

문제

링크

풀이

#include <iostream>
using namespace std;
 
void solve(void) {
  int d; cin >> d;
 
  int t = 0;
  while (t*t+t <= d) t++;
  cout << t-1 << "\n";
}
 
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
 
  int t; cin >> t;
  while (t--) solve();
  return 0;
}