#include <functional>
#include <algorithm>
#include <iostream>
#include <utility>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cstring>
#include <vector>
#include <cstdio>
#include <string>
#include <stack>
#include <deque>
#include <queue>
#include <cmath>
#include <map>
#include <set>
//#include <bits/stdc++.h>
//#define pb push_back
//#define pf push_front
//#define ppb pop_back
//#define ppf pop_front
#define lwb lower_bound
#define upb upper_bound
#define X first
#define Y second
//#define FOR(i,j,k) for(int i = j; i < (int)(k); i++)
//#define FORV(i, v) FOR(i, 0, ((v).size()))
//#define sz(a) (int)((a).size())
//#define all(a) a.begin() , a.end()
#define coud(a,b) cout<<fixed << setprecision((b)) << (a)
#define L(x) ((x)<<1)
#define R(x) (((x)<<1)+1)
//#define int long long
#define double long double
#define joon ios :: sync_with_stdio(false)
//#define cin fin
//#define cout fout
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
const double pi = acos(-1);
const double eps = 1e-7;
int main()
{
joon;
cin.tie(0);
double a,r;
cin>>a>>r;
double tet=a/(2*r);
tet=asin(tet)*180.0/pi;
tet*=2;
double s=pi*r*r;
s*=tet/360.0;
double r2=r;
r2*=r2;
double bh=a/2.0;
bh*=bh;
r2-=bh;
double oh=(double)sqrt(r2);
oh*=a;
oh/=2.0;
s-=oh;
cout<< fixed << setprecision(12) << s << endl;
return 0;
}
I2luY2x1ZGUgPGZ1bmN0aW9uYWw+CiNpbmNsdWRlIDxhbGdvcml0aG0+CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPHV0aWxpdHk+CiNpbmNsdWRlIDxzc3RyZWFtPgojaW5jbHVkZSA8aW9tYW5pcD4KI2luY2x1ZGUgPG51bWVyaWM+CiNpbmNsdWRlIDxjc3RkbGliPgojaW5jbHVkZSA8Y3N0cmluZz4KI2luY2x1ZGUgPGNsaW1pdHM+CiNpbmNsdWRlIDxjc3RyaW5nPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8Y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