#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main() {
// your code goes here
double t, p, s;
cin>>t;
while(t--) {
cin>>p>>s;
cout<<fixed<<setprecision(2)<<(pow((p-(sqrt(pow(p, 2)-(24*s))))/12, 2)*((p/4)-(2*((p-(sqrt(pow(p, 2)-(24*s))))/12))))<<endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CiNpbmNsdWRlIDxpb21hbmlwPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CgkvLyB5b3VyIGNvZGUgZ29lcyBoZXJlCglkb3VibGUgdCwgcCwgczsKCWNpbj4+dDsKCXdoaWxlKHQtLSkgewoJCWNpbj4+cD4+czsKCQljb3V0PDxmaXhlZDw8c2V0cHJlY2lzaW9uKDIpPDwocG93KChwLShzcXJ0KHBvdyhwLCAyKS0oMjQqcykpKSkvMTIsIDIpKigocC80KS0oMiooKHAtKHNxcnQocG93KHAsIDIpLSgyNCpzKSkpKS8xMikpKSk8PGVuZGw7Cgl9CglyZXR1cm4gMDsKfQ==