#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int n, m, k;
struct MyStruct
{
int ti, ci;
};
bool cmp(MyStruct a, MyStruct b)
{
return a.ti < b.ti;
}
int sumRes(vector<MyStruct> vec, int ki)
{
int s = 0;
for (auto& it : vec)
{
s += max(0, (it.ti - ki) * it.ci);
}
return s;
}
int main()
{
cin >> n >> m >> k;
vector<MyStruct>vec(n);
for (size_t i = 0; i < n; i++)
{
cin >> vec[i].ti >> vec[i].ci;
}
sort(vec.begin(), vec.end(), cmp);
int dayMin = k, dayMax = vec[n - 1].ti, mid = 0, sum = 0;
while (true)
{
mid = (dayMin + dayMax) / 2;
sum = sumRes(vec, mid);
if ((sum == m) || (sum < m && sumRes(vec, mid - 1)>m) || (mid == k))
{
cout << mid;
break;
}
else if (sum < m)
{
dayMax = mid;
}
else if (sum > m)
{
dayMin = mid;
}
}
return 0;
}