思想:
代码:
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
LL gcd(LL n, LL m){
if(n % m == 0) return m;
return gcd(m, n % m);
}
LL f(LL k){
LL sum = 1;
while(k --) sum *= 10;
return sum;
}
void solve(){
int n, k; cin >> n >> k;
cout << n * f(k) / gcd(n, f(k)) << endl;
}
int main(){
int _; cin >> _;
while(_ --) solve();
return 0;
}