
There is a hotel with n rooms. The rooms are represented by a 2D integer array rooms where rooms[i] = [roomId _i , size _i ] denotes that there is a room with room number roomId _i and size equal to size _i . Each roomId _i is guaranteed to be unique .
You are also given k queries in a 2D array queries where queries[j] = [preferred _j , minSize _j ] . The answer to the j ^th query is the room number id of a room such that:
The room has a size of at least minSize _j , and
abs(id - preferred _j ) is minimized , where abs(x) is the absolute value of x .
If there is a tie in the absolute difference, then use the room with the smallest such id . If there is no such room , the answer is -1 .
Return an array answer of length k where answer[j] contains the answer to the j ^th query .
n == rooms.length1 <= n <= 10 ^5k == queries.length1 <= k <= 10 ^41 <= roomId _i , preferred _j <= 10 ^71 <= size _i , minSize _j <= 10 ^7