#include using namespace std; #define rep(i,n) for(int i=0; i=0; i--) #define all(x) (x).begin(), (x).end() bool chmax(auto& a, auto b) { return ab ? a=b, 1: 0; } using ll=long long; const int INF=1e9+10; const ll INFL=4e18; #ifdef DEBUG #include "./debug.hpp" #else #define debug(...) #define print_line #endif using ull=unsigned long long; using lll=__int128_t; constexpr lll operator ""_lll(ull x) { return static_cast(x); } constexpr const lll INFLL=1_lll<<120; istream& operator>>(istream& is, lll& x) { int c=is.peek(); while(c==' '||c=='\n') is.get(), c=is.peek(); bool neg=false; if(c=='-') neg=true, is.get(); x=0; while(isdigit(is.peek())) x=x*10+is.get()-'0'; if(neg) x=-x; return is; } ostream& operator<<(ostream& os, lll x) { if(x<0) os<<'-', x=-x; if(x==0) return os<<'0'; string s; while(x>0) s+=x%10+'0', x/=10; reverse(all(s)); return os<8------------------------------------------->8------ void run() { int N; cin>>N; vector A(N); rep(i,N) cin>>A[i]; lll ans=1; rep(i,N) if(i) { lll d=1; lll a=A[i]; while(a) { a/=10; d*=10; } d/=gcd(A[i],d); ans=ans*d/gcd(ans,d); } cout<>T; while(T--) run(); }