#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned int ui; #define sim template < class c #define ris return * this #define dor > debug & operator << #define eni(x) sim > typename enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) { sim > struct rge {c b, e; }; sim > rge<c> range(c i, c j) { return rge<c>{i, j}; } sim > auto dud(c* x) -> decltype(cerr << *x, 0); sim > char dud(...); struct debug { #ifdef LOCAL ~debug() { cerr << endl; } eni(!=) cerr << boolalpha << i; ris; } eni(==) ris << range(begin(i), end(i)); } sim, class b dor(pair < b, c > d) { ris << "(" << d.first << ", " << d.second << ")"; } sim dor(rge<c> d) { *this << "["; for (auto it = d.b; it != d.e; ++it) *this << ", " + 2 * (it == d.b) << *it; ris << "]"; } #else sim dor(const c&) { ris; } #endif }; #define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] " // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); // ll my_rand(ll l, ll r) { // return uniform_int_distribution<ll>(l, r) (rng); // } void tcase(int Tcase) { int n, x, y, temp, gap = 0; scanf("%d %d %d",&n, &x, &y); int a[n+5]; memset(a, 0, (n+5)*sizeof(a[0])); for(int i = 0; i < x; i++){ scanf("%d",&temp;); a[temp] = 1; } for(int i = 1; i < n-1; i++){ if(a[i] && a[i+2]){ gap++; if(a[i+1]){ x--; a[i+1] = 0; } } } if(a[n-1] && a[1]){ gap++; if(a[n]){ x--; a[n] = 0; } } if(a[n] && a[2]){ gap++; if(a[1]){ x--; a[1] = 0; } } printf("%dn",x-2+gap); } int main(){ int T = 1; scanf("%d",&T); for(int Tcase = 1; Tcase <= T; Tcase++){ tcase(Tcase); } //tcase(); }