Pages

Friday, 30 January 2015

SPOJ solution of CHOTU ( FARIDI AND YADAV)

#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
int main()
{
    int t;
    double x,y,s;
    cin>>t;
    while(t--)
    {
        cin>>x>>y;
        s=sqrt(pow(x,2)-pow(y,2));
        s=s*2;
        cout<<fixed<<setprecision(3)<<s<<endl;
    }
    return 0;
}

No comments:

Post a Comment