-
-
Save enzerr/441221f2ce8df982d6898ea519c43eff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
using namespace std; | |
const int maxn = 1e5 + 5; | |
int v[maxn]; | |
int32_t main(){ | |
int n, k; cin >> n >> k; | |
for(int i = 1; i <= n; i++){ | |
int a, b; cin >> a >> b; | |
v[i] = a%b; | |
} | |
sort(v+1, v+n+1); | |
cout << v[k] << '\n'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment