Please help with Pascal!!

Hi, ok... Here's the story- I have been absent from my Pascal programming class for 3 weeks, I came back and now the teacher wants me to try out a few programs for a test tomorrow. I have one that I have no idea how to do...

Here are the directions:
"Mr.Paul has an amusement park. On one ride, there are many different cabins painted different colors. Since the colors evoke different emotions, each cabin is priced individually.
A group of friends want to ride Mr.Paul's cabin ride. They want to sit together, or in cabins right next to each other.
The amount of friends: N
The capacity of one cabin: K
The amount of cabins: M

Now, the program will get these numbers from a file on the desktop (the file should have N,K,M separated by a space, plus the $$ amount each cabin costs), then it should calculate how many cabins are needed, then which combination is the cheapest for the friends.
So, for an example:
Input: 7 2 10
80 70 40 90 100 60 70 80 80 50

Good luck!"

Ok, so I have absolutely no idea.
I wanted to ask you for help- please please please if anyone knows how to make this program, don't hesitate to write at least a little part of it.
Thank you!!!!