There are N line segments numbered from 1 to N, and the length of each segment is given. Choose exactly K of these segments and use them as the sides of a K-gon. Each segment may be used at most once.
Two choices are considered different if there is a segment number used in one choice that is not used in the other. Segments with the same length are still different when their numbers are different.
A chosen set of K segments can form a K-gon when the longest chosen segment is shorter than the sum of the other K-1 chosen segments. Count how many different choices can form a K-gon.