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

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

CF 1774A - Add Plus Minus Sign

2023-08-18 14:22 作者:您是打尖兒還是住店呢  | 我要投稿

AquaMoon has a string a consisting of only 0 and 1. She wants to add + and ? between all pairs of consecutive positions to make the absolute value of the resulting expression as small as possible. Can you help her?


Input

The first line contains a single integer t (1≤t≤2000)? – the number of test cases. The description of test cases follows.

The first line of each test case contains a single integer n (2≤n≤100) — the length of a.

The second line of each test case contains a string a of length n, consisting of only 0 and 1.

Output

For each test case, output a string of length n?1 consisting of ? and + on a separate line. If there is more than one assignment of signs that produces the smallest possible absolute value, any of them is accepted.

Example

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

AquaMoon 有一個僅由 0 和 1 組成的字符串 a。她想在所有連續(xù)位置對之間添加 + 和 ?,以使結(jié)果表達(dá)式的絕對值盡可能小。 你能幫助她嗎?


輸入

第一行包含一個整數(shù) t (1≤t≤2000) – 測試用例的數(shù)量。 測試用例的描述如下。

每個測試用例的第一行包含一個整數(shù) n (2≤n≤100) — a 的長度。

每個測試用例的第二行包含一個長度為n的字符串a(chǎn),僅由0和1組成。

輸出

對于每個測試用例,在單獨的行上輸出一個長度為 n?1 的字符串,其中包含 - 和 +。 如果存在多個產(chǎn)生最小可能絕對值的符號分配,則接受其中任何一個。

例子

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

目的是和最小,當(dāng)是奇數(shù)的時候,可以加,當(dāng)時偶數(shù)的時候就減,即可;

下面是代碼;


CF 1774A - Add Plus Minus Sign的評論 (共 條)

分享到微博請遵守國家法律
宜昌市| 望江县| 徐闻县| 横山县| 台东市| 广水市| 宁德市| 日土县| 丰台区| 沙河市| 泰兴市| 武宁县| 扶绥县| 壤塘县| 峨边| 卓资县| 砀山县| 客服| 盈江县| 永和县| 克山县| 珠海市| 海宁市| 漾濞| 武义县| 杭锦后旗| 南召县| 温宿县| 常熟市| 仁怀市| 新巴尔虎右旗| 泰州市| 临泉县| 临安市| 屏东市| 基隆市| 扎兰屯市| 根河市| 葵青区| 辽宁省| 胶南市|