Problem

Source: Junior Olympiad of Malaysia Shortlist 2015 C4

Tags: combinatorics



Nikees has a set $S$ of $n$ points on a plane and decides to colour them. All $\dbinom{n}{2}$ line segments are drawn and they have distinct lengths. Find the maximum number of colours that are used at least once, given that: (a) For each point $P$, the two endpoints of the longest line segment connecting $P$ must be of the same colour. (b) For each point $P$, the two endpoints of the shortest line segment connecting $P$ must be of the same colour.