#include <cstdio>
#include <iostream>
#include <set>
#include <algorithm>
using namespace std;
typedef long long ll;
int main() {
int T;
while(~scanf("%d", &T)) {
int cas = 0;
ll a, b;
while(T-- > 0) {
cin >> a >> b;
ll s = b*(b+1) / 2;
ll d = a*(a-1) / 2;
printf("Case #%d: ", ++cas);
cout << s*s-d*d << endl;
}
}
return 0;
}
HDU 5053 the Sum of Cube 2014 ACM/ICPC Asia Regional Shanghai Online
最新推荐文章于 2019-04-07 16:38:20 发布