#include using namespace std; #define int long long #define all(x) x.begin(), x.end() #define app push_back #ifdef LOCAL #define debug(...) [](auto...a){ ((cout << a << ' '), ...) << '\n';}(#__VA_ARGS__, ":", __VA_ARGS__) #else #define debug(...) #endif int32_t main() { ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); int t;cin>>t; while(t--) { int n;double s;cin>>n>>s; int res=0; for(int i=1;i<=1000 && i<=n;++i) { double low=(s-0.000)*i; double up=(s+0.001)*i; //debug(low,up); int j=up; bool ok=0; if(j+0.0>=low && j+0.0=low && j+0.0