#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n; cin >> n;
while (n--)
{
double x, y; cin >> x >> y;
double l = x - y; double al = abs(l);
double r = x + y; double ar = abs(r);
if (l * r < 0) { cout << 0 << endl; continue; }
if (1.0 <= ar) { cout << (int)l << endl; continue; }
if (l < 0) swap(al, ar);
bool hit = false;
int nn, dd;
for (int i = 1.0 / ar; !hit; ++i)
{
for (dd = 1; dd < i; ++dd)
{
nn = i - dd;
double num = (double)nn / dd;
if (al <= num && num <= ar) { hit = true; break; }
}
}
cout << ((l < 0) ? "-" : "") << nn << "/" << dd << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpCnsKCWludCBuOyBjaW4gPj4gbjsKCgl3aGlsZSAobi0tKQoJewoJCWRvdWJsZSB4LCB5OyBjaW4gPj4geCA+PiB5OwoJCWRvdWJsZSBsID0geCAtIHk7IGRvdWJsZSBhbCA9IGFicyhsKTsKCQlkb3VibGUgciA9IHggKyB5OyBkb3VibGUgYXIgPSBhYnMocik7CgoJCWlmIChsICogciA8IDApIHsgY291dCA8PCAwIDw8IGVuZGw7IGNvbnRpbnVlOyB9CgkJaWYgKDEuMCA8PSBhcikgeyBjb3V0IDw8IChpbnQpbCA8PCBlbmRsOyBjb250aW51ZTsgfQoJCWlmIChsIDwgMCkgc3dhcChhbCwgYXIpOwoKCQlib29sIGhpdCA9IGZhbHNlOwoJCWludCBubiwgZGQ7CgkJZm9yIChpbnQgaSA9IDEuMCAvIGFyOyAhaGl0OyArK2kpCgkJewoJCQlmb3IgKGRkID0gMTsgZGQgPCBpOyArK2RkKQoJCQl7CgkJCQlubiA9IGkgLSBkZDsKCQkJCWRvdWJsZSBudW0gPSAoZG91YmxlKW5uIC8gZGQ7CgkJCQlpZiAoYWwgPD0gbnVtICYmIG51bSA8PSBhcikgeyBoaXQgPSB0cnVlOyBicmVhazsgfQoJCQl9CgkJfQoJCWNvdXQgPDwgKChsIDwgMCkgPyAiLSIgOiAiIikgPDwgbm4gPDwgIi8iIDw8IGRkIDw8IGVuZGw7Cgl9CgoJcmV0dXJuIDA7Cn0K