Teachers and parrents

Instructions:

The table describes the number of passengers entering and leaving at stations A, B, C ... Bus arrives without passengers at the first station. All passengers get off on the last station. We do keep rules of decency - first get off and then get in.

Example

 
A
B
C
D
E
 got off 
0 0
4 2
0 0
3 5
17 10
 got on 
5 8
0 0
 in bus
4 5
8 5
 altogether
27


Solution

 
A
B
C
D
E
 got off 
0 0
4 2
0 0
3 5
17 10
 got on 
4 5
8 2
7 2
5 8
0 0
 in bus
4 5
8 5
15 7
17 10
 altogether
9
13
22
27


Solve exercises