Program to determine total stops taken by elevator
So you said that the elevator works with the first come first serve basis. That screams like using a Queue. Moreover i like using classes as much as possible because i feel that implementing a solution becomes very easy because the abstraction is more on a human level and the readability increases.
I demonstrate it on my code.



So first you know that you have Persons who want to drive from ground to a Target Floor. A Person also have a Weight. So i have implemented this in a class:

public class Person
{
    public int Weight { get; set; }

    public int ActualFloor { get; set; }

    public int TargetFloor { get; set; }

    public Person(int weight, int targetFloor, int actualFloor = 0)
    {
        this.Weight = weight;
        this.TargetFloor = targetFloor;
        this.ActualFloor = actualFloor;
    }
}




Naming:
Moreover you know that the Elevator has different attributes too. You have implemented them in Y for Maximum Weight and X for the Maximum Number of People and i think that X and Y are really bad names for MaxWeight and MaxPeople. Why not name them what they are? That makes it easier for you as the coder and easier for other coworkers trying to understand your code.

My Elevator Properties and the Constructor are implemented as this:

public class Elevator
{
    public readonly int MaxWeight;

    public readonly int MaxPersons;

    public readonly int MaxFloors;

    public Queue&lt;Person&gt; Persons { get; set; }

    private List&lt;Person&gt; Passengers { get; set; }

    public Elevator(int maxFloors, int maxWeight, int maxPersons)
    {
        this.MaxFloors = maxFloors;
        this.MaxPersons = maxPersons;
        this.MaxWeight = maxWeight;
        this.Persons = new Queue&lt;Person&gt;();
        this.Passengers = new List&lt;Person&gt;();
    }
}


MaxWeight, MaxPersons and MaxFloors should be clear. The Queue Persons contains the People you want to drive around. Passengers are the People which are in this cycle in the elevator.

Now you can calculate the number of stops very easy:

public int CalculateNumberOfStops()
{
    int stops = 0;

    while (!this.Persons.IsEmpty())
    {
        while (this.IsOneMorePersonFitting())
        {
            this.Passengers.Add(this.Persons.Dequeue());
        }

        stops += this.Passengers.GroupBy(x =&gt; x.TargetFloor).Count();
        this.Passengers.Clear();

        // Drive to Floor Zero
        stops++;
    }

    return stops;
}

private bool IsOneMorePersonFitting()
{
    return !this.Persons.IsEmpty() &amp;&amp;
           this.Passengers.Sum(x =&gt; x.Weight) + this.Persons.Peek().Weight &lt; this.MaxWeight &amp;&amp;
           this.Passengers.Count &lt; this.MaxPersons;
}


I am shifting the People from the Queue into the List as long the cap of the elevator is not full and the Queue is not empty. 
The number of stops are calculated with the number of Groups in the List. If you have 2 Passengers and Pass 1 wants to Floor 1 and Pass 2 wants to Floor 2 then you will have two groups. But if both want to the same Floor then you will only have one group. 



You can add persons and error check with a helper function like this:

public void AddPersons(IEnumerable&lt;Person&gt; persons)
{
    foreach (var person in persons)
    {
        // Check if person is valid:
        if (person.TargetFloor &gt; this.MaxFloors ||
            person.Weight &gt; this.MaxWeight)
        {
            throw new ArgumentException();
        }

        this.Persons.Enqueue(person);
    }
}


I extended the Methods of Queue with the IsEmpty function to make is a little easier to read:

public static class ExtensionHelper
{
    public static bool IsEmpty&lt;T&gt;(this Queue&lt;T&gt; queue)
    {
        return queue.Count == 0;
    }
}




Using the elevator:

static void Main(string[] args)
{
    var elevator = new Elevator(5, 200, 2);
    elevator.AddPersons(new[] { new Person(60, 2), new Person(80, 3), new Person(40, 5) });
    var stops = elevator.CalculateNumberOfStops();

    Console.WriteLine(stops);
    Console.ReadKey();
}




For better readability you could define an empty constructor and then use it as

var elevator = new Elevator() { MaxWeight = 200, MaxPersons = 2 };


but then you can't use a readonly field and the programmer must know what is needed for the instance.