Unusual elevator algorithm An elevator with a capacity of N people in a building with E floors works in a pretty unusual way. 

The elevator starts at the first floor and it goes to the top floor before returning to the first floor. 

It stops at every floor that is a destination of a person in the elevator. 

It also stops when 1) there is someone at the current floor who wants to travel in the same direction as the elevator is currently traveling and 2) there is still room in the elevator.

At least how many round trips to the top and back are necessary to carry every person to their destination?

I assume that some kind of Greedy algorithm can give a good algorithm to solve this problem, but I still have no idea how to write a pseudocode for it.
I don't see any optimisation problem, no need for any greedy algorithm, nothing. 

You described the behaviour of the elevator. All you need to do is to simulate that behaviour and count the number of movements.