UVA 10678 - The Grazing Cow

UVA Sep 01, 2020

Problem PDF

Solution:

#include
#include
#include
#include
#include
#include
#include
#include
#define pi 2*acos(0.0)
using namespace std;
int main()
{

    unsigned long long i;
    cin>>t;
    while(t--){
        double x,y;
        cin>>x>>y;
        double t;
        t=sqrt((y/2)*(y/2)-(x/2)*(x/2));
        printf("%.3lf\n",pi*y/2*t);

    }


return 0;
}
https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/10678/10678.cpp

Tags

Shipu Ahamed

CSPO® | Partly Product, Project Manager and Partly Software Engineer.

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.