#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
long long findGap(int T, int N){
set<long long> st;
long long pre = -1, prepre = 1e18;
prepre++;
vector<long long> a;
while(1){
long long mn = pre, mx = prepre;
MinMax(pre + 1, prepre - 1, &mn, &mx);
if(mn == -1) break;
pre = mn;
prepre = mx;
a.push_back(mn);
if(mn != mx){
a.push_back(mx);
}
if(a.size() == N) break;
}
sort(a.begin(), a.end());
// for(auto i : a) cerr << i << ' ';
// cerr << endl;
long long res = 0;
for(int i = 1; i < N; i++){
res = max(res, a[i] - a[i - 1]);
}
return res;
}