五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(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的評論 (共 條)

分享到微博請遵守國家法律
库尔勒市| 宜君县| 堆龙德庆县| 城固县| 应城市| 柳州市| 华坪县| 手游| 松江区| 磴口县| 定襄县| 宜城市| 梁山县| 大石桥市| 高尔夫| 东阿县| 扶余县| 佛教| 喜德县| 聊城市| 抚松县| 甘肃省| 城市| 来宾市| 东乌珠穆沁旗| 土默特右旗| 延津县| 繁昌县| 盐源县| 镇赉县| 鞍山市| 陇南市| 璧山县| 南宫市| 平顶山市| 武山县| 临海市| 吉林省| 平果县| 霍城县| 汾西县|