时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld
题目描述
When you are playing multiplayer games, you may want to show that you are the MVP of your team -- or blame the one always wandering and watching away from the storm center. Well, there're statistics that show you preformance, but sometimes numbers speak softer than charts. Now, you're hired to write a program that output ASCII art histograms showing damage dealt to enemies.
There are n players in the game. Given that the i-th player dealt

damage to enemies where

is granted, you need to calculate the number

of spaces in the bar by the following foluma:
Instead of formal definition of bar description, we will give an example. For some player i whose

and

, the bar is shown as:
+-------+
| |777
+-------+
Moreover, you have to mark the player with maximal damage dealt to enemies by replacing the last space into '*'. If there're multiple maximum, mark all of them.
See samples for more ideas.
输入描述:
The first line contains one integer
)
.
The next n line each contains one integer, the i-th line contains
)
.
It's granted that

.
输出描述:
3n lines, each 3 lines denote a bar in the correct format.
示例1
输出
复制
+--------------------------------------------------+
| *|50
+--------------------------------------------------+
+----------------------------------------+
| |40
+----------------------------------------+
+--------------------------------------------------+
| *|50
+--------------------------------------------------+
++
||0
++
示例2
输出
复制
+--------------------+
| |1676
+--------------------+
+--------------------------------------------------+
| *|4396
+--------------------------------------------------+
+--------------------------+
| |2200
+--------------------------+
+------+
| |443
+------+
+-------+
| |556
+-------+