fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. long long n,k;
  4. const long long MaxN = 1e6;
  5. pair<long long,long long> a[MaxN+5];
  6. int main()
  7. {
  8. if(fopen("pointk.inp","r"))
  9. {
  10. freopen("pointk.inp","r",stdin);
  11. freopen("pointk.out","w",stdout);
  12. }
  13.  
  14. cin >> n >> k;
  15. for (long long i=1; i<=n; i++)
  16. {
  17. cin >> a[i].first >> a[i].second;
  18. }
  19. sort(a+1,a+1+n);
  20. cout << a[k].first << " " << a[k].second;
  21. }
  22.  
Success #stdin #stdout 0.01s 5296KB
stdin
Standard input is empty
stdout
0 0