#include using namespace std; using Int=long long; using Real=long double; templateinline bool chmin(T&A,S B){if(A>B){A=B;return true;}else{return false;}} templateinline bool chmax(T&A,S B){if(A>N; cin>>X>>Y; int ans=Y-X; REP(i,N-1) { cin>>X>>Y; if(ans!=Y-X)drop(-1); } if(ans<1)drop(-1); cout<>TE; while(TE--)sol(); }