Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #define pi 3.14
- int main()
- {
- double x,y;
- scanf("%lf %lf", &x, &y);
- double r = y/4.0;
- double cir_area = pi*r*r;
- double a = x - r;
- double b = r*2.0;
- double c = (a*a) + (b*b);
- double tri_area = (y/4.0) * sqrt((4.0*c) - (y*y));
- if((cir_area+tri_area) >= (x*y)) printf("-1\n");
- else printf("%lf\n", (x*y)- (cir_area+tri_area));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement