#include
#include <math.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;long long int n;int w;long long int bet_combi;
while(t–)
{
cin>>n>>w;
long long int bet=n-2;
//cout<<bet<<endl;
bet_combi=pow(10,bet);
//cout<<bet_combi<<endl;
long long int count=0;
if(w>=0){
count=9-abs(w);
}
else
{
count=10-abs(w);
}
long long int tot;
tot=bet_combi*count;
//cout<<tot<<endl;
cout<<(tot%(10^9 + 7))<<endl ;
}
return 0;
}
- List item