#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int INF = 1001001001;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};

int main() {
    long double n,d,h;
    cin >> n >> d >> h;
    double mx=0,dx=0;
    rep(i,n){
        double di,hi;
        cin >> di >> hi;
        double k = (hi-h)/(di-d);
        double b = h-(k*d);
        mx = max(b,mx);
    }
    if(mx<=0.0){
        cout << 0.0 <<endl;
    }else{
        cout << mx << endl;
    }
    return 0;
}
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <map> //http://vivi.dyndns.org/tech/cpp/map.html
#include <set> //http://vivi.dyndns.org/tech/cpp/set.html
#include <vector>
#include <deque>
#include <queue>
#include <numeric> //gcd,lcm c++17
#include <tuple>
#include <iomanip> //setprecision
#include <unordered_map>
#include <chrono>
//#define _GLIBCXX_DEBUG
using namespace std;
template <typename T>
using vc = vector<T>;
template <typename T>
using vv = vc<vc<T>>;
template <typename T>
using PQ = priority_queue<T, vc<T>, greater<T>>;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;
//typedef __uint128_t Int;
using vi = vc<int>;
using vl = vc<ll>;
using vd = vc<double>;
#define FOR(i, a, b) for (int i = a; i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define ALL(a) (a).begin(), (a).end()
#define sz(x) (int)(x).size()
template <class T1, class T2, class Pred = std::less<T2>>
struct sort_pair_second
{
    //sort_pair_second<ll,ll,greater<ll>>()
    bool operator()(const std::pair<T1, T2> &left, const std::pair<T1, T2> &right)
    {
        Pred p;
        return p(left.second, right.second);
    }
};
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
int MOD = 1e9 + 7;
double EPS = 1e-9;
int INF = 2000000005;
long long INFF = 1000000000000000005LL;
double PI = acos(-1);
int dirx[8] = {-1, 0, 0, 1, -1, -1, 1, 1};
int diry[8] = {0, 1, -1, 0, -1, 1, -1, 1};
int rdx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int rdy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

vi G[200000];
int mx, mn;
vc<pi> A(200000);
bool visited[200000] = {};
int ans = -INF;

void dfs(int v)
{
    if (sz(G[v]))
        visited[v] = true;
    for (auto x : G[v])
    {
        if (visited[x])
            continue;
        chmax(ans, A[x].first - mn);
        dfs(x);
    }
}

int main()
{
    int N, M;
    cin >> N >> M;
    A.resize(N);
    FOR(i, 0, N)
    {
        cin >> A[i].first;
        A[i].second = i;
    }
    auto B = A;
    sort(ALL(B));
    FOR(i, 0, M)
    {
        int x, y;
        cin >> x >> y;
        x--, y--;
        G[x].push_back(y);
    }
    FOR(i, 0, N)
    {
        if (visited[B[i].second])
            continue;
        mn = B[i].first;
        dfs(B[i].second);
    }
    cout << ans << endl;
}