Good problems (or at least problems I enjoy)

 Let a $$k$$-cycle of an ordered list $$(a_{1}, a_{2}, \dots, a_{n})$$ be the ordered list $$(a_{n-k+1}, \dots, a_{n}, a_{1}, a_{2}, \dots, a_{n-k})$$. Given an ordered list of $$n$$ numbers, determine in linear time how many of the $$k$$-cycles are such that all $$n$$ partial sums are nonnegative. Five points are placed on a sphere. What is the largest $$N$$ such that no matter where the points are placed, there is a closed hemisphere containing $$N$$ of the points? There are $$n$$ coins arranged in a line from left to right. If there are exactly $$k > 0$$ coins showing heads, we flip the $$k$$th coin from the left; otherwise, we stop. Show that for any initial configuration of the coins, we will stop after a finite number of flips.