We Are Discuss About CODECHEF SOLUTION

Facebook Codechef Solution

Facebook Codechef Solution

Answers will be Uploaded Shortly and it will be Notified on Telegram, So JOIN NOW
JoinScishowEngineerTelegram

Problem

A post on facebook is said to be more popular if the number of likes on the post is strictly greater than the number of likes on some other post. In case the number of likes is same, the post having more comments is more popular.

Given arrays  and , each having size , such that the number of likes and comments on the ��ℎ post are �� and �� respectively, find out which post is most popular.

It is guaranteed that the number of comments on all the posts is distinct.

Input Format

  • The first line of input will contain a single integer , denoting the number of test cases.
  • Each test case consists of multiple lines of input.
    • The first line of each test case contains a single integer , the number of posts.
    • The second line of each test case contains  space-separated integers �1,�2,…,�� — where �� is the number of likes on the ��ℎ post.
    • The third line of each test case contains  space-separated integers �1,�2,…,�� — where �� is the number of comments on the ��ℎ post.

Output Format

For each test case, output on a new line, an integer in the range 1 to , denoting the index of the post which is most popular among the  posts.

Constraints

  • 1≤�≤1000
  • 1≤�≤105
  • 1≤��,��≤2⋅105
  • The elements of array  are distinct.
  • It is guaranteed that the sum of  over all test case does not exceed 2⋅105.

Sample 1:

Input

Output

4
3
5 4 4
1 2 3
3
10 10 9
2 5 4
3
3 3 9
9 1 3
4
2 8 1 5
2 8 1 9
1
2
3
2

Explanation:

Test case 1: The number of likes on the first post is greater than that of second and third post. Thus, the first post is most popular.

Test case 2: The first and second post have maximum number of likes. But, the second post has more comments than the first post. Thus, the second post is most popular.

Test case 3: The number of likes on the third post is greater than that of first and second post. Thus, the third post is most popular.

Test case 4: The number of likes on the second post is greater than that of first, third, and fourth post. Thus, the second post is most popular.

Answers will be Uploaded Shortly and it will be Notified on Telegram, So JOIN NOW
JoinScishowEngineerTelegram

 

SOLUTION

Here Discuss About Facebook Codechef Solution

SOLUTION

Facebook Codechef Solution

SOLUTION

Yhaa You have done it but next? if YOU Want to Get Others Please Visit Here ScishowEngineer   Then Follow US HERE and Join Telegram.

If You Want To Learn Something New Then Visit Our Official Channel YOUTUBE

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *