Answer:
The total of ways the buildings can be painted are = 4
3
2
2
1 = 48 ways.
Explanation:
i) color five buildings that are in a row.
ii) any two neighboring buildings must be different colors
iii) the first third and fifth buildings must be different colors.
iv) the number of ways to paint the fist building are 4.
v) the number of ways to paint the second building are 3.
vi) the number of ways to paint the third building are 2.
vii) the number of ways to paint the fourth building are 2.
viii) the number of ways to paint the last building are 1.
ix) therefore the total of ways the buildings can be painted are
= 4
3
2
2
1 = 48 ways.