
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Let  $n \geq 2$  be a positive integer, and suppose buildings of height  $1, 2, \ldots, n$  are built
in a row on a street. Two distinct buildings are said to be  $\emph{roof-friendly}$  if every building
between the two is shorter than both buildings in the pair. For example, if the buildings are
arranged  $5, 3, 6, 2, 1, 4,$  there are  $8$  roof-friendly pairs:  $(5, 3), (5, 6), (3, 6), (6, 2), (6, 4), (2, 1),$  $(2, 4), (1, 4).$  Find, with proof, the minimum and maximum possible number of roof-friendly
pairs of buildings, in terms of  $n.$ 

Present the answer in LaTex format: \boxed{Your answer}
user