分析:
打表+二分
#include <iostream>
#include<algorithm>
#include<cmath>
#define maxn 1e18+99
typedef long long ll;
using namespace std;
ll T,x,l,r,mid,cnt;
ll a[50010];
void init(){cnt=0;for(ll i=1;i<maxn;i*=2){for(ll j=1;i*j<maxn;j*=3){for(ll k=1;i*j*k<maxn;k*=5){a[cnt++]=i*j*k;}}}
}int main(){std::ios::sync_with_stdio(false);init();sort(a,a+cnt);cin>>T;while(T--){cin>>x;l=1;r=cnt;while(l<=r){mid=(l+r)/2;if(a[mid]>=x){r=mid-1;}else {l=mid+1;}}cout<<a[l]<<endl;}return 0;
}