Company: Tekion_SDE intern_On-campus_3july
Difficulty: medium
Maximum Participants Assigned to Rooms There are n participants and m available rooms. Participant i prefers a room area preferred[i]; room j has area rooms[j]. A participant can be assigned a room only when abs(preferred[i] - rooms[j]) <= d. Each participant can receive at most one room, and each room can be assigned to at most one participant. Return the maximum possible number of assigned participants. Input Format The input consists of the following values, each of which may be separated by arbitrary whitespace: 1. n, the number of participants. 2. m, the number of rooms. 3. d, the maximum permitted difference. 4. n, followed by the n values of preferred. 5. m, followed by the m values of rooms. Output Format Print one integer: the maximum number of compatible one-to-one assignments. Example 4 3 5 4 45 60 80 60 3 30 60 75 2 One participant preferring 60 can receive room 60, and the participant preferring 80 can receive room 75. No room is compatible with the participant preferri