1025. Fashion Shows

http://www.spoj.com/problems/FASHION/