Question: You might have already noticed that on Google search engine website, there is a button Im feeling lucky. This can allow you skip the search

 You might have already noticed that on Google search engine website,

You might have already noticed that on Google search engine website, there is a button Im feeling lucky. This can allow you skip the search result page and it goes directly to the first ranked page. It saves a lot of your time. But, when you type something in the search box and then press Im feeling lucky' button, do you know which web page will appear? Google did a lot of research on this and certainly, now-a-days, will simply amaze you with its action. Let us assume that Google assigns every web page an integer-valued relevance score. The most related page (i.e., the page with higher score) will be chosen. If there is a tie, all the pages with the highest relevance score are possible to be chosen. Your task is simple, given N web pages and their corresponding relevance scores, list out all the possible candidate pages which will be served to the user when Im feeling lucky button is pressed. Input: Input starts with a line consisting of a single number T. T test cases follow. Each test case starts with a line consisting of a single number N, denoting the number of webpages to consider. Then in each of the following N lines, there will be the name of the webpage and an integer Si denoting the relevance score of the webpage. The webpage URL length can be at most 200 characters. And 1 lessthanorequalto Si lessthanorequalto 100. Output: For each test case, please print the list of URLs of the web pages which are most likely will be selected. The order of the URLs is the same as the input. Please look at the sample output for further information of output format

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!