AT_abc411_b [ABC411B] Distance Table
Description
There are $ N $ stations, station $ 1 $ , station $ 2 $ , $ \ldots $ , station $ N $ , arranged in this order on a straight line.
Here, for $ 1\leq i\leq N-1 $ , the distance between stations $ i $ and $ (i+1) $ is $ D_i $ .
For each pair of integers $ (i,j) $ satisfying $ 1\leq i
Input Format
The input is given from Standard Input in the following format:
> $ N $ $ D_1 $ $ D_2 $ $ \ldots $ $ D_{N-1} $
Output Format
Output $ N-1 $ lines.
On the $ i $ -th line $ (1\leq i\leq N-1) $ , output $ (N-i) $ integers, separated by spaces.
The $ j $ -th integer on the $ i $ -th line $ (1\leq j\leq N-i) $ should be the distance between stations $ i $ and $ (i+j) $ .
Explanation/Hint
### Sample Explanation 1
The distances between stations are as follows:
- The distance between stations $ 1 $ and $ 2 $ is $ 5 $ .
- The distance between stations $ 1 $ and $ 3 $ is $ 5+10=15 $ .
- The distance between stations $ 1 $ and $ 4 $ is $ 5+10+2=17 $ .
- The distance between stations $ 1 $ and $ 5 $ is $ 5+10+2+3=20 $ .
- The distance between stations $ 2 $ and $ 3 $ is $ 10 $ .
- The distance between stations $ 2 $ and $ 4 $ is $ 10+2=12 $ .
- The distance between stations $ 2 $ and $ 5 $ is $ 10+2+3=15 $ .
- The distance between stations $ 3 $ and $ 4 $ is $ 2 $ .
- The distance between stations $ 3 $ and $ 5 $ is $ 2+3=5 $ .
- The distance between stations $ 4 $ and $ 5 $ is $ 3 $ .
Thus, output as shown above.
### Constraints
- $ 2 \leq N \leq 50 $
- $ 1 \leq D_i \leq 100 $
- All input values are integers.