#include using namespace std; typedef long long ll; int main(){ ll q,d,x,t; cin>>q; for(int i=0; i>d>>x>>t; d-=1; ll y=0; if(d==0){ y=1; } else if(d==1){ y=x+1; } else if(d==2){ for(int j=1; j<=x+1; ++j){ y+=j; } } else if(d==3){ for(int j=1; j<=x+1; ++j){ ll z=0; for(int k=1; k<=j; ++k){ z+=k; } y+=z; } } else { ll e=d-1; for(int j=1; j<=x+1; ++j){ ll z=1; for(int k=0; k