简单题
View Code
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
using namespace std;
int main()
{
//freopen("D:\\t.txt", "r", stdin);
int t;
scanf("%d", &t);
long long n,m;
for (int i = 0; i < t; i++)
{
scanf("%I64d%I64d", &n, &m);
long long ans1 = (n + m), ans2 = (m - n + 1);
if (ans1 % 2 == 0)
ans1 /=2;
else
ans2 /=2;
printf("Scenario #%d:\n", i + 1);
printf("%I64d\n\n", ans1 * ans2);
}
return 0;
}