#include #include using namespace std; using namespace atcoder; using mint=modint998244353; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int T; cin>>T; for(int i=0; i>N>>M; N%=M*2; if(N<=M){ cout<<(((mint)10).pow(N)-1).val()<<'\n'; } else{ cout<<(((mint)10).pow(M)-((mint)10).pow(N%M)).val()<<'\n'; } } }