#include <stdio.h>
#include <math.h>
int main()
{ int cases=0;
scanf("%d",&cases);
int i=0;
int n,m;
int sum;
for(i=0;i<cases;i++){
scanf("%d %d",&n,&m);
sum=ceil((n-2)/3.0)*ceil((m-2)/3.0);
printf("%d\n",sum);
}
return 0;
}
#include <math.h>
int main()
{ int cases=0;
scanf("%d",&cases);
int i=0;
int n,m;
int sum;
for(i=0;i<cases;i++){
scanf("%d %d",&n,&m);
sum=ceil((n-2)/3.0)*ceil((m-2)/3.0);
printf("%d\n",sum);
}
return 0;
}
No comments:
Post a Comment