#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a>n; using D = long double; while(n--){ D a,b; cin>>a>>b; D l=log10(a)*b; int z=floor(l); D r=l-z; D p=pow(10.0,r); int x=floor(p); int y=floor(p*10)-x*10; cout<