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.

18 lines
353 B
C++

#include <cstdio>
using namespace std;
int main()
{
int x,y;
while(~scanf("%d%d",&x,&y))
{
long long ans1=0,ans2=0;
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;
}