#include<iostream> using namespace std; int main(void) { int n,i,a,b; long long s[100]; while(cin>>n) { s[2]=1; s[3]=2; for(b=4;b<100;++b) { s[b]=s[b-1]+s[b-2]; } for(i=0;i<n;++i) { cin>>a>>b; if(a!=1) { b=b-a+1; } cout<<s[b]<<endl; } } }