KKM theorems and applications to problems in discrete geometry