OJ-Problems-Source/HDOJ/1046_autoAC.cpp

24 lines
487 B
C++
Raw Normal View History

2016-08-12 10:14:21 +08:00
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
using namespace std;
int main(void)
{
int n;
scanf("%d", &n);
for (int i = 1; i < n + 1; ++i)
{
printf("Scenario #%d:\n", i);
int s, t;
scanf("%d%d",&s,&t);
double sum;
sum = s*t;
if ((s*t)%2)
printf("%.2f\n", sum+sqrt(2)-1);
else printf("%.2f\n", (double)sum);
printf("\n");
}
return 0;
}