题解 | #翻转翻转#

翻转翻转

https://www.nowcoder.com/practice/ad11db28e0f44a1c97af06fd002477a1

#include<iostream>
#include<climits>
#include<vector>
#include<algorithm>
#include<numeric>
#include <string>
using namespace std;



int main(){
    int T;
    cin>>T;
    long long m,n;
    while(T--){
        cin>>m>>n;
        if(m==1||n==1){
            int big=max(m,n);
            if(big==1) cout<<1<<endl;
            else if(big>=2){
                cout<<big-2<<endl;
            }
        }else{
            cout<<(m-2)*(n-2)<<endl;
        }
    }



    system("pause");
    return 0;
}

全部评论

相关推荐

程序员牛肉:你这简历有啥值得拷打的?在牛客你这种简历一抓一大把,也就是个人信息不一样而已。 关键要去找亮点,亮点啊,整个简历都跟流水线生产出来的一样。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务