Computer Programming Contest Preparation

ToolBox - Source for: 116/11614/b.cpp



/home/toolbox/public_html/solutions/116/11614/b.cpp
    1 #include <stdio.h>
    2 #include <math.h>
    3 
    4 int main()
    5 {
    6     int t;
    7     long long n;
    8     scanf("%d", &t);
    9     while(t--)
   10         {
   11             scanf("%lld", &n);
   12             printf("%lld\n", (long long)floor(sqrt( 2.0 * n + 0.25 ) + 0.5) - 1);
   13         }
   14     return 0;
   15 }
   16