#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;
}
#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