QOJ.ac

QOJ

Limite de temps : 1 s Limite de mémoire : 512 MB Points totaux : 100

#6268. 指点江山

Statistiques

数列 $a_1, a_2, \dots, a_n$ が与えられます。あなたは以下の操作を任意の回数行うことができます。

  • $i$ を選び、$a_i$ を $-(a_1+a_2+\cdots+a_n)$ に置き換える。

得られる辞書順最小の数列 $a$ を求めてください。

入力

一行目に正整数 $n$ が与えられます。

二行目に $n$ 個の整数が昇順で与えられます。

出力

辞書順最小の数列を構成する $n$ 個の整数を一行に出力してください。

入出力例

入力 1

3
2 -3 2

出力 1

-3 -1 2

サンプル説明 1

$[2,-3,2] \to [2, -1, 2] \to [-3, -1, 2]$

小課題

すべてのデータにおいて、$1\leq n\leq 10^5$、$|a_i|\leq 10^9$ を満たします。

テストケース $1\sim 4$ については、$n\leq 5$ を満たします。

テストケース $5\sim 7$ については、$n\leq 10^3$ を満たします。

テストケース $8\sim 10$ については、特別な制約はありません。

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.