Dev Skill DCP-28: Circle and Square Solution


Problem Link
Dev Skill Solution DCP-28: Circle and Square
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        float r,s;
        cin>>r>>s;
        r=r*2;
        s=sqrt(2)*s;

        if(r==s || abs(s-r)<=0.01)
            cout<<"Yes"<<endl;
        else
            cout<<"No"<<endl;
    }
    return 0;
}

No comments

Theme images by enjoynz. Powered by Blogger.