Pagini recente » Istoria paginii runda/tema_asd | Cod sursa (job #1715860) | Cod sursa (job #1042440) | Cod sursa (job #459039) | Cod sursa (job #49929)
Cod sursa(job #49929)
# include <stdio.h>
int main()
{
long long int n,m,lat,sol;
FILE *f=fopen("dreptunghiuri.in","r");
fscanf(f,"%lld%lld",&n,&m);
sol=n*(n-1)*m*(m-1)/4;
if (n>m) {lat=m;m=n;n=lat;}
for (lat=3;lat<=n;lat++)
sol+=(n-lat+1)*(m-lat+1)*(lat-2);
FILE *g=fopen("dreptunghiuri.out","w");
fprintf(g,"%lld\n",sol);
fcloseall();
return 0;
}