Company: Rubrik_23nov
Difficulty: medium
Where to Place Servers? Problem Description A data center rack has n slots, numbered 1 through n from left to right. Each slot is either empty or occupied by exactly one active server. When a new server is deployed, the system assigns it an empty slot that maximizes the minimum physical distance to the nearest active server. If several empty slots achieve that same maximum, the system selects the one with the lowest index (leftmost). If the rack is entirely empty, the server is assigned slot 1. The physical distance between slots i and j is |i - j|. Given a chronological record of server deployments and decommissionings, determine the slot assigned to each newly deployed server. Input Format The first line contains two space-separated integers n and m - the number of rack slots and the number of records. Each of the next m lines contains two space-separated integers t_i and id_i: * If t_i = 1, server id_i is deployed. * If t_i = 2, server id_i is decommissioned and its slot becomes emp