#include <iostream>
using namespace std;
int main()
{ long long n,m,z,c,sum=0,count1=0,count2=0;
cin>>n>>m;
for(long long i=1;i<=n;i++)
{
count1+=i;}
for(long long t=1;t<=m;t++)
{
count2+=t;}
int a=count1*count2;
while(n!=0&&m!=0)
{z=n*m;
n--;
m--;
sum=sum+z;
}
c=a-sum;
cout<<sum<<" "<<c<<endl;
return 0;
}
因为错了啊
int a数据溢出了,改成longlong就好了