using namespace std; #include #define BEGIN ios_base::sync_with_stdio(0);cin.tie(0); #define END return EXIT_SUCCESS; #define FOR(I,A,B) for(int (I)=(A);(I)<(B);++(I)) #define ALL(C) (C).begin(),(C).end() typedef unsigned long long ull; inline void solve() { ull N;cin>>N; vectorS(N); ull T=0; FOR(i,0,N) { ull a,b;cin>>a>>b; S[i]=a+4*b; T=max(T,S[i]); } ull M=0; FOR(i,0,N) { M+=(T-S[i]); if(M%2==0) { M/=2; } } if(M%2==0)cout<<(M/2)<