国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

CF 1849A - Morning Sandwich

2023-08-16 11:46 作者:您是打尖兒還是住店呢  | 我要投稿

Monocarp always starts his morning with a good ol' sandwich. Sandwiches Monocarp makes always consist of bread, cheese and/or ham.


A sandwich always follows the formula:

a piece of bread a slice of cheese or ham a piece of bread…

a slice of cheese or ham a piece of bread

So it always has bread on top and at the bottom, and it alternates between bread and filling, where filling is a slice of either cheese or ham. Each piece of bread and each slice of cheese or ham is called a layer.


Today Monocarp woke up and discovered that he has b pieces of bread, c slices of cheese and h slices of ham. What is the maximum number of layers his morning sandwich can have?

Input

The first line contains a single integer t (1≤t≤1000) — the number of testcases.

Each testcase consists of three integers b,c and h (2≤b≤100; 1≤c,h≤100) — the number of pieces of bread, slices of cheese and slices of ham, respectively.

Output

For each testcase, print a single integer — the maximum number of layers Monocarp's morning sandwich can have.

--------------------------------------

Monocarp 總是以美味的三明治開始新的一天。 Monocarp 制作的三明治通常由面包、奶酪和/或火腿組成。


三明治總是遵循以下公式:

一片面包一片奶酪或火腿一片面包……

一片奶酪或火腿 一塊面包

所以它的頂部和底部總是有面包,并且它在面包和餡料之間交替,其中餡料是一片奶酪或火腿。 每片面包和每片奶酪或火腿稱為一層。


今天Monocarp醒來發(fā)現(xiàn)他有b片面包,c片奶酪和h片火腿。 他的早餐三明治最多可以有多少層?

輸入

第一行包含一個整數(shù) t (1≤t≤1000) — 測試用例的數(shù)量。

每個測試用例由三個整數(shù) b、c 和 h 組成(2≤b≤100;1≤c,h≤100)——分別是面包片、奶酪片和火腿片的數(shù)量。

輸出

對于每個測試用例,打印一個整數(shù) - Monocarp 的早晨三明治可以有的最大層數(shù)。

--------------------------------

確定三明治的最大層次,其實(shí)就是判斷面包跟火腿還有起司的數(shù)量即可,下面是代碼:


CF 1849A - Morning Sandwich的評論 (共 條)

分享到微博請遵守國家法律
蓬安县| 大英县| 福贡县| 苏州市| 广灵县| 洛浦县| 化州市| 且末县| 连州市| 东乌| 运城市| 蛟河市| 襄垣县| 平安县| 北宁市| 青铜峡市| 化德县| 桃园县| 长治市| 富阳市| 驻马店市| 永兴县| 临朐县| 信丰县| 东阿县| 枣阳市| 六盘水市| 美姑县| 新龙县| 成武县| 乌拉特后旗| 太仓市| 诏安县| 红桥区| 呈贡县| 新野县| 鄂托克前旗| 武汉市| 婺源县| 肥城市| 赣榆县|