无码av一区二区三区无码,在线观看老湿视频福利,日韩经典三级片,成 人色 网 站 欧美大片在线观看

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

分享到微博請遵守國家法律
鄂伦春自治旗| 淳安县| 土默特左旗| 临沧市| 江安县| 垦利县| 本溪市| 乐东| 措勤县| 红原县| 崇阳县| 桐庐县| 彭山县| 台中市| 宁强县| 东阿县| 馆陶县| 大关县| 西乌| 桦南县| 永和县| 岑溪市| 铁岭县| 漳平市| 永登县| 上杭县| 共和县| 福安市| 安溪县| 岳池县| 天柱县| 澳门| 长顺县| 从化市| 通渭县| 乌兰察布市| 都江堰市| 买车| 河源市| 台江县| 陕西省|