#include using namespace std; int a,b,q; int main() { cin>>q; ++q; while(--q) { cin>>a>>b; b-=a; cout<<1LL*(1LL*2*b+1)<<'\n'; } return 0;}