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
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