SOLUTION
NOTE: THIS WAS ATTEMPTED LAST MINUTE DUE TO NOT HAVING ACCESS TO THE
QUESTIONS EARLIER, HENCE NOT THAT PERFECT. NEXT TIME, ONCE ONE OF YOU
HAS THE QUESTIONS AND NEEDS HELP, PLEASE SEND THEM EARLY.
, OUTPUT
Source code, just copy and paste
#include <iostream>
#include <fstream>
#include <queue>
#include <string>
#include <sstream>
#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
// Structure to represent a passenger
struct Passenger {
char destinationType; // 'S', 'L', or 'C'
int boardingTime; // Time needed to board
int arrivalTime; // Time when passenger arrived
int remainingTime; // Remaining boarding time
int id; // Passenger ID (for tracking)
Passenger(char type, int time, int arrival, int id) :
destinationType(type), boardingTime(time), arrivalTime(arrival),
remainingTime(time), id(id) {}
};
// Structure to represent a taxi
struct Taxi {
int capacity; // Maximum capacity
int currentPassengers; // Current number of passengers