310264: CF1807A. Plus or Minus

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Plus or Minustime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

You are given three integers $a$, $b$, and $c$ such that exactly one of these two equations is true:

  • $a+b=c$
  • $a-b=c$
Output + if the first equation is true, and - otherwise.Input

The first line contains a single integer $t$ ($1 \leq t \leq 162$) — the number of test cases.

The description of each test case consists of three integers $a$, $b$, $c$ ($1 \leq a, b \leq 9$, $-8 \leq c \leq 18$). The additional constraint on the input: it will be generated so that exactly one of the two equations will be true.

Output

For each test case, output either + or - on a new line, representing the correct equation.

ExampleInput
11
1 2 3
3 2 1
2 9 -7
3 4 7
1 1 2
1 1 0
3 3 6
9 9 18
9 9 0
1 9 -8
1 9 10
Output
+
-
-
+
+
-
+
+
-
-
+
Note

In the first test case, $1+2=3$.

In the second test case, $3-2=1$.

In the third test case, $2-9=-7$. Note that $c$ can be negative.

Input

题意翻译

给定3个整数$a$,$b$,$c$,使得下列两个式子其中之一成立: - $a+b=c$ - $a-b=c$ 若第一个式子成立则输出+,否则输出-

Output

题目大意:
这个题目是关于判断两个数是相加还是相减得到第三个数的问题。你将会得到三个整数a, b, c,其中恰好有一个等式成立:
1. a + b = c
2. a - b = c
你需要输出 "+" 如果第一个等式成立,否则输出 "-"。

输入输出数据格式:
输入:
第一行包含一个整数t(1 ≤ t ≤ 162)——测试用例的数量。
每个测试用例包含三个整数a, b, c(1 ≤ a, b ≤ 9,-8 ≤ c ≤ 18)。输入数据的附加约束是:输入数据将会生成得使得恰好有一个等式成立。

输出:
对于每个测试用例,输出一个 "+" 或 "-",代表正确的等式。

示例:
输入:
11
1 2 3
3 2 1
2 9 -7
3 4 7
1 1 2
1 1 0
3 3 6
9 9 18
9 9 0
1 9 -8
1 9 10

输出:
+
-
-
+
+
-
+
+
-
-
+题目大意: 这个题目是关于判断两个数是相加还是相减得到第三个数的问题。你将会得到三个整数a, b, c,其中恰好有一个等式成立: 1. a + b = c 2. a - b = c 你需要输出 "+" 如果第一个等式成立,否则输出 "-"。 输入输出数据格式: 输入: 第一行包含一个整数t(1 ≤ t ≤ 162)——测试用例的数量。 每个测试用例包含三个整数a, b, c(1 ≤ a, b ≤ 9,-8 ≤ c ≤ 18)。输入数据的附加约束是:输入数据将会生成得使得恰好有一个等式成立。 输出: 对于每个测试用例,输出一个 "+" 或 "-",代表正确的等式。 示例: 输入: 11 1 2 3 3 2 1 2 9 -7 3 4 7 1 1 2 1 1 0 3 3 6 9 9 18 9 9 0 1 9 -8 1 9 10 输出: + - - + + - + + - - +

加入题单

算法标签: