#include<iostream> #include<cstdio> using namespace std; int main(){ long long n,m,i,ans; scanf("%lld",&i); for(int kase=1;kase<=i;kase++){ scanf("%lld%lld",&n,&m); printf("Scenario #%d:\n",kase); printf("%lld\n\n",(n+m)*(m-n+1)/2); } return 0; }
2024-04-02 15:11:46
#include<iostream> #include<cstdio> using namespace std; int main(){ long long n,m,i,ans; scanf("%lld",&i); for(int kase=1;kase<=i;kase++){ scanf("%lld%lld",&n,&m); printf("Scenario #%d:\n",kase); printf("%lld\n\n",(n+m)*(m-n+1)/2); } return 0; }
下一篇:poj 2301(水题)