LearnPy Hub
← Matplotlib Charts problems
Hard

Grouped Bar Positions

Read category names, then g groups of values (one line per group). Draw grouped bars: with width w = 0.8 / g, group i's bars go at x = position − 0.4 + w/2 + i·w for positions 0, 1, 2, …. Draw each group with one ax.bar call. Print, for each group, the bar centres (bar.get_x() + bar.get_width() / 2) rounded to 2 decimals on one line, then the total number of bars on the axes.

Input

Names, g, then g lines.

Output

g + 1 lines.

Sample 1

Input
A B C
2
1 2 3
4 5 6
Output
-0.20 0.80 1.80
0.20 1.20 2.20
6

Sample 2

Input
Q1
1
10
Output
0.00
1
solution.py
Output appears here
Grouped Bar Positions · Python practice problem · LearnPy Hub