果然是数学题
#include <iostream> #include <cstdio> #include <cmath> using namespace std; int n,a,b; int main() { cin>>n; int k=1; while(n--) { printf("Scenario #%d: ",k++); cin>>a>>b; if(a%2==0||b%2==0) { printf("%.2lf ",a*b*1.0); } else { printf("%.2lf ",a*b-1+sqrt(2.0)); } puts(""); } }