#include typedef long long ll; using namespace std; int INF = 1e9; int MOD = 1000000007; double power(double x,ll n){ if(n == 0)return 1; double ans = power(x*x,n/2); if(n % 2 == 1)ans = ans * x; ans /= pow(10,floor(log10(ans))); return ans; } main(){ int N; cin >> N; for(int i = 0;i < N;i++){ ll A,B; cin >> A >> B; double digit = log10(A); double d = 1.*A/pow(10,floor(digit)); // cout << d << endl; printf("%2.1f %.0f\n",power(d,B),floor(digit*B)); } }