Total length = number of intervals × interval length
Interval length = total length ÷ number of intervals
Number of intervals = total length ÷ interval length
Tree planting problem
(1) Planting trees at both ends;
Tree = interval+1
(2) planting only one end:
Tree = number of intervals
(3) No planting at both ends: tree = interval-1
(4) Closed: tree = interval number.
Example:
Reference:/view/c 8176af700ab68a982fb1c.html.