Company: Flipkart_24july
Difficulty: medium
A hospital wants to identify emergency patients who are at risk of a delayed bed allocation. The hospital stores patient arrival records, department details, doctor assessment records, triage records, and bed allocation logs. Your task is to compute a bed allocation risk score for each patient and print those whose risk level is HIGH or MEDIUM and who do not already have a bed. The risk score is derived from the patient's waiting time, latest triage severity and vital status, latest doctor priority, the patient's department pressure and criticality, and the patient's age. Read input from STDIN and write output to STDOUT. Do not print any extra debug text, as it will be treated as part of the answer and cause the test cases to fail. Data Structures Patients Table — each row has the fields: patientId — unique identifier of the patient patientName — name of the patient departmentId — department requested for bed allocation arrivalDay — day on which the patient arrived in th