现在的位置: 首页 > 综合 > 正文

hdoj 2524

2019年07月31日 ⁄ 综合 ⁄ 共 256字 ⁄ 字号 评论关闭

http://acm.hdu.edu.cn/showproblem.php?pid=2524

/*
 首先考虑行 : 1格 : n个 2格: n-1个 …. 共有 n * (n+1) /2 种
 同理 列 也是 m * ( m + 1 ) / 2 种方式,
 接下来就是组合起来 :(n*(n+1)*m*(m+1)/4) 种
*/

#include <stdio.h>
int main()
{
 int t,n,m;
 scanf("%d",&t);
 while(t--)
 {
  scanf("%d %d",&n,&m);
  printf("%d\n",n*(n+1)*m*(m+1)/4);
 }
 return 0;
}

 

【上篇】
【下篇】

抱歉!评论已关闭.