答案与m,n的奇偶性有关,考虑特殊情况。
#include<bits/stdc++.h>
using namespace std;
int n,m;
double ans;
int main(){
freopen("church.in","r",stdin);
freopen("church.out","w",stdout);
scanf("%d%d",&n,&m);
if(n==1||m==1)ans=(double)(n+m-2)*2;
else
if((n*m)%2)ans=(double)(n*m-1)+1.414;
else ans=(double)(n*m);
printf("%.2lf",ans);
return 0;
}