You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#include <cstdio>
|
|
#include <algorithm>
|
|
using namespace std;
|
|
int main()
|
|
{
|
|
int x,y;
|
|
while(~scanf("%d%d",&x,&y))
|
|
{
|
|
long long ans1=0,ans2=0;
|
|
if(x>y) swap(x,y);
|
|
for(int i=x; i<=y; i++)
|
|
if(i&1)
|
|
ans2+=(1ll*i*i*i);
|
|
else
|
|
ans1+=(1ll*i*i);
|
|
printf("%lld %lld\n",ans1,ans2);
|
|
}
|
|
return 0;
|
|
}
|