//简单题,经过分析只要将m*n的积分奇数和偶数讨论就可以了!
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
int tc, m, n, c = 0;
double sum;
cin >> tc;
while (tc--)
{
c++;
cin >> m >> n;
sum = m * n;
cout << "Scenario #" << c << ":" << endl;
if ((int)sum % 2 == 0)
printf("%.2lf\n", sum);
else
{
sum = sum-1+ sqrt(double (2));
printf("%.2lf\n", sum);
}
cout << endl;
}
system("pause");
}
poj 1450 Gridland
最新推荐文章于 2024-09-27 11:26:03 发布