Thursday, May 31, 2018

UVA - 11614 .cpp file

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long  t,a,s;
    cin>>t;
    while(t--)
    {
        cin>>s;
        a=(-1+sqrt(1+4*2*s))/2;
        cout<<a<<"\n";

    }
    return 0;
}

No comments:

Post a Comment