#include #define LL long long using namespace std; const int P=1e9+7; LL dp[2005][2005]; int main(){ LL res; dp[1][0]=1; for(int i=2;i<=1000;++i){ for(int k=0;k<=1000;++k) dp[i][k]=dp[i-1][k]; for(int j=max(1,i-11);j>T; int n,m; while(T--){ scanf("%d%d",&n,&m); printf("%d\n",dp[n][m]==0?-1:dp[n][m]); } return 0; }