Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define mp make_pair
- #define e1 first
- #define e2 second
- #define pb push_back
- typedef pair <int, int> PII;
- typedef unsigned int ui;
- typedef unsigned long long int ull;
- typedef long long int ll;
- typedef long double ld;
- typedef pair <int, ll> PIL;
- typedef pair <ll, int> PLI;
- typedef pair <ll, ll> PLL;
- const int mod = 1e9+7;
- const int inf = 1e9+9;
- const ll MOD = 1e9+696969;
- const ll INF = ll(1e18) + 3;
- const ld PI = 3.1415926535897932;
- ld a, r;
- ld WYNALL;
- ld todegree(ld a)
- {
- return a * (180.0 / PI);
- }
- void F(ld a, ld r)
- {
- ld apol = a * 0.5;
- ld pole = PI * r * r;
- ld katrad = asin(a / (2 * r) );
- ld katdeg = todegree(katrad) * 2;
- ld wyn = (katdeg / 360) * pole;
- ld H = sqrt(r*r - apol * apol);
- wyn -= (apol * H);
- WYNALL += wyn;
- }
- int main()
- {
- ld r1, r2;
- cin >> a >> r1 >> r2;
- F(a, r1); F(a, r2);
- cout << fixed;
- cout << setprecision(15);
- cout << WYNALL;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement