fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int t;
  6. cin>>t;
  7. while(t--){int p,s;
  8. cin>>p>>s;
  9. double k,l;
  10. k=(p/2-pow(p*p/4-6*s,0.5))/6;
  11. l=p/4-2*k;
  12. cout<<setprecision(2)<<fixed<<l*k*k<<"\n";
  13.  
  14.  
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0s 4368KB
stdin
2
20 14
20 16
stdout
3.00
4.15