mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
24 lines
487 B
C++
24 lines
487 B
C++
|
#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;
|
||
|
}
|