First line: T denoting the number of test cases • Each of the next T lines: A single integer N the number of pillows for a round
Answers
Answered by
0
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;
}
Similar questions