Click Here to go back to the homepage.

Half a Cookie Solution:


#include <bits/stdc++.h>
using namespace std;

int main(){
    // #ifndef TESTING
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // #endif

    cout << fixed << setprecision(4);
    double r, x, y;
    while(cin >> r >> x >> y){
        if(sqrt(x * x + y * y) >= r){
            cout << "miss" << endl;
        } else {
            double h = r - sqrt(x * x + y * y);
            double area = r * r * 3.141592653589793238462643383;
            double seg_area = r * r * acos((r - h) / r) - (r - h) * sqrt((2 * r * h - h * h));
            cout << area - seg_area << " " << seg_area << endl;
        }
    }

    return 0;
}