#include <stdio.h>
#include <math.h>
int main()
{ int i,cases;
long sum;
scanf("%d",&cases);
for(i=0;i<cases;i++){
scanf("%ld",&sum);
printf("%ld\n",(long)((-1+sqrt(1+8*sum))/2.0));
}
return 0;
}
#include <math.h>
int main()
{ int i,cases;
long sum;
scanf("%d",&cases);
for(i=0;i<cases;i++){
scanf("%ld",&sum);
printf("%ld\n",(long)((-1+sqrt(1+8*sum))/2.0));
}
return 0;
}
No comments:
Post a Comment