#include using namespace std; const double eps = 0.00000001; int main(){ int T; cin >> T; for (int i = 0; i < T; i++){ int N; long long K; cin >> N >> K; K--; vector prime(N + 1, true); vector mobius(N + 1, 1); for (int j = 2; j <= N; j++){ if (prime[j]){ mobius[j] = -1; for (int k = j * 2; k <= N; k += j){ prime[k] = false; mobius[k] *= -1; } } } for (int j = 2; j * j <= N; j++){ for (int k = j * j; k <= N; k += j * j){ mobius[k] = 0; } } double tv = 0, fv = 1000000; for (int j = 0; j < 100; j++){ double mid = (tv + fv) / 2; long long ans = 0; for (int k = 1; k <= N; k++){ for (int l = 1; l <= N / k; l++){ if (mid >= (double) N / k / l){ ans += mobius[k] * (N / k); } else { ans += mobius[k] * (int) (mid * l); } } } if (ans <= K){ tv = mid; } else { fv = mid; } } bool ok = false; for (int j = 1; j <= N; j++){ double x = tv * j; if (x <= N + eps){ if (abs(x - (int) (x + eps)) <= eps){ cout << (int) (x + eps) << '/' << j << endl; ok = true; break; } } } if (!ok){ cout << -1 << endl; } } }