Maintain a PBDS( Policy based data structure) for the leaderboard and the current information for each team.
For sorting, use the win rate and id of a team.
Operation 1 : Erase the teams from the pbds and insert again with new information.
Operation 2: Using the win rate of the given team, perform a binary search on the leaderboard to find out the number of teams with higher ranks.
Operation 3: Get the team in rank
postion of the pbds. Find out the rank of that team. If it is equal to the given rank
, it is the desired team. Otherwise print -1
.