| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 38434 | 郭澍宇 | 【J】T1 | C++ | 通过 | 100 | 1 MS | 252 KB | 631 | 2025-10-08 14:08:36 |
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll n,m;int t; int main(){ //freopen("board.in","r",stdin); //freopen("board.out","w",stdout); cin>>t; while(t--){ cin>>n>>m; if(1ll*n*m%2==1){ printf("N\n-1\n"); continue; } printf("Y\n"); if(n%2==0&&m%2==0){ printf("%lld\n",1ll*n/2*m/2); continue; } if(n%2==0){ printf("%lld\n",1ll*(n>>1)*(m>>1)+n/2); continue; } printf("%lld\n",1ll*(n>>1)*(m>>1)+m/2); } } //O(1) 100pts