您的位置:首页 > 其它

UVa 11044 - Searching for Nessy

2014-04-19 16:31 537 查看
传送门UVa 11044 - Searching for Nessy

这题够水...

因为要忽略掉边框, 把给出的行列各减去二就可以了. 然后各除以三, 向上取整...



#include <cstdio>
#include <cmath>

using namespace std;

int main()
{
//freopen("input.txt", "r", stdin);
int T;
double row, colomn;
double rnum, colnum;
scanf("%d", &T);
while (T--)
{
scanf("%lf%lf", &row, &colomn);
row -= 2;
colomn -= 2;
rnum = ceil(row / 3);
colnum = ceil(colomn / 3);
printf("%d\n", (int)(rnum * colnum + 0.5));
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ACM UVa 11044