#include using namespace std; using ll =long long; #define all(v) v.begin(),v.end() #define rep(i,a,b) for(int i=a;i=b;i--) ll INF=2e18; void solve() { ll N;cin>>N; string S;cin>>S; string t=""; for(auto x:S) { if(x=='.') continue; t+=x; } ll a=stoll(t); ll ans=0; for(ll i=1;i<=min(2000LL,N);i++) { if(a*i%1000==0) { ans++; continue; } ll x=a*i/1000; ll y=(a+1)*i/1000; if(x+12000) ans+=N-2000; cout<=1000のとき, */ int main() { ios::sync_with_stdio(false); cin.tie(0); ll t;cin>>t; for(ll i=0;i