#include #include using namespace std; using namespace atcoder; #define ll long long #define rep(i,a,b) for(int i=(a);i<(b);i++) #define repl(i,a,b) for(ll i=(a);i<(b);i++) #define all(a) (a).begin(),(a).end() #define rall(a) (a).rbegin(),(a).rend() template bool chmin(T &a,T b){if(a>b){a=b;return true;} return false;} template bool chmax(T &a,T b){if(a> n; int d2=0,d5=0; auto f=[](int x) -> int{ int res=0; while(x){ res++; x/=10; } return res; }; rep(i,0,n){ int a; cin >> a; if(i == 0 || a == 0) continue; int dig=f(a); int x=0,y=0; while(a%2 == 0){ x++; a/=2; } while(a%5 == 0){ y++; a/=5; } chmax(d2,dig-x),chmax(d5,dig-y); } ll ans=1; rep(i,0,d2) ans*=2; rep(i,0,d5) ans*=5; cout << ans << "\n"; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int T; cin >> T; while(T--) solve(); }