308896: CF1593A. Elections

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

Description

Elections

题意翻译

### 题目描述 三名候选人参加竞选 。第一名候选人得到了 $a$ 票,第二名候选人得到了 $b$ 票,第三名候选人得到了 $c$ 票 。对于每一个候选人,解决以下问题 : 至少给该候选人增加多少票,使得该候选人的票数严格大于其它候选人? 注意,每个问题是独立存在的 。 ### 输入格式 第一行包含一个整数 $t$ $(1\leq t\leq 10^4)$,表示数据组数 。 每组数据包含三个整数 $a$,$b$,$c$,$(0\leq a,b,c\leq 10^9)$ 分别表示三个候选人的票数 。 ### 输出格式 每组数据输出三个整数,用空格隔开,分别表示三个问题的答案 。

题目描述

The elections in which three candidates participated have recently ended. The first candidate received $ a $ votes, the second one received $ b $ votes, the third one received $ c $ votes. For each candidate, solve the following problem: how many votes should be added to this candidate so that he wins the election (i.e. the number of votes for this candidate was strictly greater than the number of votes for any other candidate)? Please note that for each candidate it is necessary to solve this problem independently, i.e. the added votes for any candidate do not affect the calculations when getting the answer for the other two candidates.

输入输出格式

输入格式


The first line contains one integer $ t $ ( $ 1 \le t \le 10^4 $ ) — the number of test cases. Then $ t $ test cases follow. Each test case consists of one line containing three integers $ a $ , $ b $ , and $ c $ ( $ 0 \le a,b,c \le 10^9 $ ).

输出格式


For each test case, output in a separate line three integers $ A $ , $ B $ , and $ C $ ( $ A, B, C \ge 0 $ ) separated by spaces — the answers to the problem for the first, second, and third candidate, respectively.

输入输出样例

输入样例 #1

5
0 0 0
10 75 15
13 13 17
1000 0 0
0 1000000000 0

输出样例 #1

1 1 1
66 0 61
5 5 0
0 1001 1001
1000000001 0 1000000001

Input

题意翻译

### 题目描述 三名候选人参加竞选 。第一名候选人得到了 $a$ 票,第二名候选人得到了 $b$ 票,第三名候选人得到了 $c$ 票 。对于每一个候选人,解决以下问题 : 至少给该候选人增加多少票,使得该候选人的票数严格大于其它候选人? 注意,每个问题是独立存在的 。 ### 输入格式 第一行包含一个整数 $t$ $(1\leq t\leq 10^4)$,表示数据组数 。 每组数据包含三个整数 $a$,$b$,$c$,$(0\leq a,b,c\leq 10^9)$ 分别表示三个候选人的票数 。 ### 输出格式 每组数据输出三个整数,用空格隔开,分别表示三个问题的答案 。

加入题单

算法标签: