hdu4925Apple Tree
//n*m的果園 , 種一棵樹,收獲一個果實
//在一個格子施肥 , 其旁邊的果樹收獲的·果實翻倍
//問最多能收獲多少果實
//交叉種樹 , 則為最大
#include
#include
#include
using namespace std ;
const int maxn = 110 ;
int map[maxn][maxn] ;
int dx[4] = {0 , 1 , 0 ,-1} ;
int dy[4] = {1 , 0 , -1 , 0} ;
int main()
{
int n , m ;
int t ;
scanf(%d , &t) ;
while(t--)
{
cin>>n>>m ;
memset(map , 0 , sizeof(map)) ;
int ans = 0 ;
for(int i = 1;i <= n;i++)
for(int j = 1;j <= m;j++)
if((i+j)%2 == 0)
{
int sum = 0 ;
for(int k = 0 ;k < 4;k++)
{
int nx = i + dx[k] ;
int ny = j + dy[k] ;
if(nx >= 1 && nx <= n && ny >= 1 && ny <= m)
sum++ ;
}
ans += (1<