-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1330A.cpp
49 lines (48 loc) · 981 Bytes
/
1330A.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <bits/stdc++.h>
using namespace std;
#define fastio() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define show(x) cerr<<(#x)<<" : "<<x<<endl;
#define ll long long
#define ld long double
#define fill(a,val) memset(a,val,sizeof(a))
#define mp make_pair
#define ff first
#define ss second
#define pii pair<ll,ll>
#define sq(x) ((x)*(x))
#define all(v) v.begin(),v.end()
#define endl "\n"
const ll MOD = 1000*1000*1000+7;
const ll MOD2 = 998244353;
const ll N = 1000*1000+5;
const double PI = 3.14159265;
ll power(ll x,ll y,ll p){ll res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;}
int main(){
fastio();
int t;
cin>>t;
while(t--){
int n,x;
cin>>n>>x;
int a[n];
int hash[1000]={0};
for(int i=0;i<n;i++){
cin>>a[i];
hash[a[i]]++;
}
int v=0;
while(x){
v++;
if(hash[v]!=0)
continue;
hash[v]++;
x--;
}
while(hash[v]!=0){
v++;
}
v--;
cout<<v<<endl;
}
}