Hard
Text Bar Chart
Read n lines of
label value (values ≥ 0, at least one positive). Print a bar chart: each label right-aligned to the longest label, then | , then a bar of # scaled so the biggest value has 20, rounding each bar with round(), then a space and the value.Input
n, then n lines.
Output
n lines.
Sample 1
Input
3 Tea 50 Coffee 20 Juice 35
Output
Tea | #################### 50 Coffee | ######## 20 Juice | ############## 35
Sample 2
Input
1 A 7
Output
A | #################### 7
Output appears here