#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
const double pi=acos(-1.0); int main()
{
double a,r;
scanf("%lf%lf",&a,&r);
if(a>=r*) printf("%.3lf\n",pi*r*r);// The circle formed by the rope is in the square
else if(r>=sqrt()*a/) printf("%.3lf\n",a*a);// The square is in the circle
else
{
double a1=a/2.0/r;
double s1=sqrt(-a1*a1);
double ji=atan(s1/a1);
double s=r*s1*a/2.0*+(pi/-ji*)*r*r/2.0*;
printf("%.3lf\n",s);
}
return ;
}

ural 1084 Goat in the Garden More articles about

  1. ural 1348 Goat in the Garden 2

    http://acm.timus.ru/problem.aspx?space=1&num=1348 #include <cstdio> #include <cstring&g ...

  2. sgu 1348 Goat in the Garden 2【 The distance between a point and a line segment 】

    link : http://acm.timus.ru/problem.aspx?space=1&num=1348 http://acm.hust.edu.cn/vjudge/contest/view ...

  3. URAL Explanation 2

    URAL Explanation 2 URAL 1082 Title Description : Output program input data , Make the program output "Beutiful Vasilisa" solution Just look at the core of the program at first , The discovery is a comparison of quick scheduling ...

  4. OJ Problem solving record plan

    Fault tolerant declaration : ① Title selected from https://acm.ecnu.edu.cn/, Don't check the deletion of the title ② All codes represent individuals only AC Submit , There is no guarantee that the solution is correct E0001  A+B Problem First AC: 2 ...

  5. Training report (2014-2015) 2014, Samara SAU ACM ICPC Quarterfinal Qualification Contest

    Solved A Gym 100488A Yet Another Goat in the Garden   B Gym 100488B Impossible to Guess Solved C Gym ...

  6. POJ 1518 A Round Peg in a Ground Hole【 Computational geometry =_= You're worth it 】

    link : http://poj.org/problem?id=1584 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22013#probl ...

  7. POJ 1584 A Round Peg in a Ground Hole【 Computational geometry =_= You're worth it 】

    link : http://poj.org/problem?id=1584 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22013#probl ...

  8. ural 2064. Caterpillars

    2064. Caterpillars Time limit: 3.0 secondMemory limit: 64 MB Young gardener didn’t visit his garden ...

  9. HDU5977 Garden of Eden( The point divide of the tree )

    subject Source http://acm.hdu.edu.cn/showproblem.php?pid=5977 Description When God made the first man, he ...

Random recommendation

  1. [No000069]Javascript in this Keyword details

    Quiz Look at the code below , Last alert What came out of it ?(chrome Press down F12, choice Console Copy and paste directly to run ) var name = "Bob"; var nameObj ...

  2. EasyUI Realize the project of site payment list

    Environment building introduce jar. To configure Spring MVC.web.xml. Log etc. Build table Automatic generation MyBatis Related documents mybatis-generator-core-1.3.2.jar <?xml ver ...

  3. Use sh-x debugging shell Script _ turn

    Reference resources :http://blog.chinaunix.net/uid-20564848-id-73502.html 1. adopt sh -x Script name  # Show script execution 2. Script set -x Options , Easy to track ...

  4. html Special symbols in

    html Special symbols in Symbol explain code   Symbol explain code   Symbol explain code " Double quotes " × Multiplication sign × ← Left arrow ← & AND Symbol & ÷ devide ÷ ...

  5. What is? NSTimer

    This article mainly introduces what is NSTimer, Please refer to the previous blog for specific use . 1. What is? NSTimer? NSTimer Namely timer It is an object that can execute our specified method at a later time or periodically from now on . ...

  6. C++ Array address problem learning essay

    Two dimensional array address problem learning , The content of this article is for reference :http://blog.csdn.net/wwdlk/article/details/6322439 #include<iostream> usi ...

  7. WCF Technical analysis 15 : Data contract agent (DataContractSurrogate) Role in serialization

    original text :WCF Technical analysis 15 : Data contract agent (DataContractSurrogate) Role in serialization [ Love links : Save a 25 A girl with acute leukemia [ There are suzhou TV economic channel < Tian tian shan hai jing > ...

  8. windows Generate the current directory tree

    tree /f > list.txt Need to run as an administrator cmd

  9. 【 original 】java socket and .net socket Communications demo

    End of agreement "##" import java.io.BufferedReader; import java.io.IOException; import java.io.InputS ...

  10. python generator (generator)、 iterator (iterator)、 Iteratable object (iterable) difference

    Three links iterator (iterator) It's a more abstract concept , Any object , If its class has next Method (next python3) and __iter__ Method to return to itself , It's the iterator Typically, a generator calls one or more yi ...