UVa:11044 - Searching for Nessy

easy……

#include
int main(){
    int t;
    while(scanf("%d", &t) != EOF){
        while(t--){
            int m, n;
            scanf("%d%d", &n, &m);
            int xc = (n - 2) % 3 ? (n - 2) / 3 + 1 : (n - 2) / 3;
            int yc = (m - 2) % 3 ? (m - 2) / 3 + 1 : (m - 2) / 3;
            printf("%d\n", xc * yc);
        }
    }
    return 0;
}


你可能感兴趣的:(OJ:UVa,题目分类:数学基础,ACM,uva,数学)