fork download
  1. #include<iostream>
  2. #include<bits/stdc++.h>
  3. #define ll long long
  4. const int ii=123456789;
  5. using namespace std;
  6.  
  7. int main(){
  8. int t;cin>>t;
  9. while(t--){
  10. int n,m,k;cin>>n>>m>>k;
  11. int a[n],b[m];
  12. vector<int>v;
  13. for(int &x:a){
  14. cin>>x; v.push_back(x);
  15. }
  16. for(int &x:b){
  17. cin>>x;
  18. v.push_back(x);
  19. }
  20. sort(v.begin(),v.end());
  21. cout<<v[k-1];
  22. cout<<endl;
  23. }
  24. }
Success #stdin #stdout 0.01s 5548KB
stdin
1
5 4 5
2 3 6 7 9
1 4 8 10
stdout
6