Hello, could someone help me to solve the following problem?

A conversation time consists of N parts. Each of first N-1 parts last for K[i] minutes, the N-th part is considered to be infinite....