Parties and seats
Submissions: 389   Accuracy:

44.21%

  Difficulty: Basic   Marks: 1
Associated Course(s):   Fork Java

Given two arrays, one is array of political parties namely -  party, and their corresponding array of seats received - seats. You have to print the political parties in lexicographical sorted order along with their seats, and highest seats received by the party.

 

Input Format:
The first line of input contains T denoting the number of testcases. T testcases follow. Each testcase contains three lines of input. The first line contains number of parties N. The second line contains the names of the parties. The third line contains the votes corresponding to each party.

Output Format:
For each testcase, in a new line, print the required answer.

User Task:
Your task is to complete the function Election2019(party, seats, n)  which accepts three arguments and prints the required result.

Constraints:
1 <= T<= 100
1 <= N <= 26
1 <= seats <= 543

Examples:
Input:

1
7
A B C D E F G
90 150 33 23 17 500 2

Output:
A 90
B 150
C 33
D 23
E 17
F 500
G 2
500

Explanation:
Testcase1:
We print parties and their respective seats in lexiographically sorted order. At the end we print the maximum seats.

** For More Input/Output Examples Use 'Expected Output' option **

Author: Soul_xhacker


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.