[list(map(lambda y: print(int(y[1])//pow(int(y[0]),2)),map(lambda x: x, [input().strip().split(' ')]))) for _ in range(int(input()))]
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef int ii;
typedef double dd;
typedef char ch;
typedef long double ld;
typedef string st;
typedef map<ll,ll> mall;
typedef vector<ll> vll;
typedef vector<ii> vii;
#define forn(n,i,j) for(ll i=j;i<n;i++)
#define forv(n,i,j,v) for(ll i=j;i<n;i++)cin>>v[i];
#define form(n,i,j) for(ll i=n-1;i>=j;i--)
#define sor(v) sort(v.begin(),v.end())
#define usor(v) sort(v.rbegin(),v.rend())
#define rev(v) reverse(v.begin(),v.end())
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define TerCo ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define W(t) ll t;cin>>t;while(t--)
#define cn(v,n) count(all(v),n)
#define point(n) fixed<<setprecision(n)
#define PI 3.14159265358979323846
int main(){
TerCo;
W(t){
ll n,s;
cin>>n>>s;
ll ans = s/(n*n);
cout<<ans<<"\n";
}
}
1426C - Increase and Copy | 520C - DNA Alignment |
767A - Snacktower | 1365A - Matrix Game |
714B - Filya and Homework | 31A - Worms Evolution |
1691A - Beat The Odds | 433B - Kuriyama Mirai's Stones |
892A - Greed | 32A - Reconnaissance |
1236D - Alice and the Doll | 1207B - Square Filling |
1676D - X-Sum | 1679A - AvtoBus |
1549A - Gregor and Cryptography | 918C - The Monster |
4B - Before an Exam | 545B - Equidistant String |
1244C - The Football Season | 1696B - NIT Destroys the Universe |
1674A - Number Transformation | 1244E - Minimizing Difference |
1688A - Cirno's Perfect Bitmasks Classroom | 219A - k-String |
952A - Quirky Quantifiers | 451B - Sort the Array |
1505H - L BREAK into program | 171E - MYSTERIOUS LANGUAGE |
630D - Hexagons | 1690D - Black and White Stripe |