#include <bits/stdc++.h>
using namespace std;
const int N = 21;
long double l, r, x[N], y[N], a[N], dp[1 << N], pi = acos(-1), eps = 1e-12;
int n;
int main() {
  cin >> n >> l >> r;
  for (int i = 0; i < n; i++)
    cin >> x[i] >> y[i] >> a[i], x[i] -= l,
        a[i] = tanl((90 - a[i]) * acosl(-1) / 180);
  for (int i = 0; i < (1 << n); i++)
    for (int j = 0; j < n; j++)
      if (i >> j & 1 ^ 1)
        dp[i | (1 << j)] = fmaxl(
            dp[i | (1 << j)],
            y[j] * a[j] + x[j] - dp[i] <= 0
                ? 1e18
                : dp[i] + (y[j] * y[j] + (x[j] - dp[i]) * (x[j] - dp[i])) /
                              (y[j] * a[j] + x[j] - dp[i]));
  cout << fixed << setprecision(17) << fminl(r - l, dp[(1 << n) - 1]);
}
