First line contains an integer T denoting the number of test cases. Next T lines contains an integer N denoting the maximum price of the item present on Philaland.
Answers
Answered by
12
Answer:
#include<iostream>
using namespace std;
int main()
{
int N,T,i,j,sum,count;
cin>>T;
if(T>=1 && T<=100)
for(i=1;i<=T;i++)
{
cin>>N;
sum=0;
count=0;
j=1;
if(N>=1 && N<=5000)
while(sum<N)
{
sum += j;
j++;
count++;
}
cout<<count;
cout<<endl;
}
return 0;
}
Explanation:
Answered by
0
Answer:
11111111111111111111111
Similar questions