int main() {
// your code goes here
int t,i;
cin>>t;
if(t>100) goto ends;
for(i=0;i<t;i++)
{
long int N,j,ctr;
long long int sum=0;
ctr=0;
sum=0;
cin>>N;
ctr= (-1+sqrt(1+8*N))/2;
cout<<ctr<<"\n";
}
ends:
return 0;
}
#include
using namespace std;
int main()
{
int T;
long long int N;
cin>>T;
while (T–)
{
cin>>N;
if (N%3==0)
cout<<(N/3)+1<<endl;
else
cout<<(N/3)+1<<endl;
}
return 0;
}
can anyone please help that why i haven’t pass any of the test cases even my ans is correct??
SOMEONE HELP!!!
int main(void) {
int t;
scanf("%d",&t);
while(t–)
{
long long int n;
scanf("%lld", &n);
long long int i, sum=0;
for(i=1; i<=n; i++)
{
sum += i;
if(sum > n)
{
i–;
break;
}
}
printf("%lld\n", i);
}
return 0;
}