国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 學(xué)院 > 開發(fā)設(shè)計(jì) > 正文

規(guī)律題

2019-11-06 06:27:05
字體:
供稿:網(wǎng)友

Description

Yuta gives Rikka a chess board of size $n /times m$. As we all know, on a chess board, every cell is either black or white and every two cells that share a side have different colors.Rikka can choose any rectangle formed by board squares and perform an inversion, every white cell becomes black, and vice versa.Rikka wants to turn all cells into the same color, please tell Rikka the minimal number of inversions she need to achieve her goal. 

Input

The first line contains a number $T(T /leq 10)$ ――The number of the testcases.Each testcase contains two numbers $n,m(n /leq 10^9, m /leq 10^9)$.  

Output

For each testcase, PRint a single number which represents the answer. 

Sample Input

 31 22 23 3   

Sample Output

 122 黑白相間的格子,選擇任意矩形反轉(zhuǎn),使全部變成一個(gè)顏色,輸出需要反轉(zhuǎn)幾次Select All
#include<cstdio>int t;int main(){	scanf("%d",&t);	while(t--){		int n,m;		scanf("%d%d",&n,&m);		int num=n/2+m/2;		printf("%d/n",num);	}	return 0; }
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 锦屏县| 光泽县| 龙里县| 衡山县| 姚安县| 济宁市| 涿鹿县| 公主岭市| 淄博市| 巫山县| 汾阳市| 雅江县| 光泽县| 米脂县| 焉耆| 邛崃市| 区。| 荥阳市| 昭觉县| 邵阳市| 辉县市| 诏安县| 成武县| 汶川县| 双城市| 突泉县| 梁平县| 义马市| 海安县| 南开区| 新干县| 宜川县| 诸城市| 安塞县| 南江县| 嘉禾县| 达孜县| 凭祥市| 封丘县| 石泉县| 桃源县|