#include #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int T;cin>>T; for(;T--;) { int N,A; cin>>N>>A; int t=0; for(int i=1;i>B; t=max(t,A-B+1); A=B; } cout<