Tuesday, March 27, 2018

DCP-473: Next Perfect Square Number

https://devskill.com/CodingProblems/ViewProblem/473


#include<bits/stdc++.h>

#define  sf scanf
#define pf printf

// Nayeem Mollick Joy , Applied Physics & Electronic Engineering , University of Rajshahi.

using namespace std;

int main(){

    int t;

    long long  n,r;

    sf ("%d",&t);

    while (t--)
    {
        sf ("%lld",&n);

        r = floor(sqrt(double(n)))+1;

        pf ("%lld\n",r*r);
    }
}

No comments:

Post a Comment