Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, k, f, t, i, ans;
- bool flag = false;
- cin >> n >> k;
- for (i=0; i<n; i++)
- {
- cin >> f >> t;
- if (t<=k)
- {
- if (f>ans)
- {
- flag = true;
- ans = f;
- }
- }
- }
- if (flag)
- cout << ans;
- else cout << -1;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment