In the city of La La Land, the sports chief is to be elected Mr Jani, who himself is a great athlete, is standing for the position. It looks like a cake for him but it is not so. Throughout his career, he has been involved in many controversies and because of this the people are divided. To challenge him, Ms. Ramya has also submitted her application. She is a fierce lady with a great track record but is considered too strict with her discipline norms. There are multiple departments in the sports authority. On the election day, each department is provided with an integer. It also means multiple persons from the same department have the same integer Election Rules: 1. Different persons belonging to the same department, have the same integer. 2. Multiple votes with the same integer will be considered as a single unique vote 3. To win, Mr. Jani should have atleast M unique votes if not, then Ms. Ramya will be elected as the Chief Officer Note: If there are 3 people belonging to one department having an integer 5 and they all vote, then it will be considered as a single unique vate

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Please code it in Java8 Or C or C++ or python ( any one of these but preferably Java)
In the city of La La Land, the sports chief is to be elected Mr. Jani, who himself is a great
athlete, is standing for the position. It looks like a cake for him but it is not so. Throughout his
career, he has been involved in many controversies and because of this the people are divided.
To challenge him, Ms. Ramya has also submitted her application. She is a fierce lady with a
great track record but is considered too strict with her discipline norms.
There are multiple departments in the sports authority. On the election day, each department is
provided with an integer. It also means multiple persons from the same department have the
same integer.
Election Rules:
1. Different persons belonging to the same department, have the same integer.
2.
Multiple votes with the same integer will be considered as a single unique vote
3
To win, Mr. Jani should have atleast M unique votes If not, then, Ms. Ramya will be
elected as the Chief Officer.
Note: If there are 3 people belonging to one department having an integer 5 and they all vote,
then it will be considered as a single unique vote
Now on election day Merenta hai
Example:
Number of people who casted their vote, N = 10
Number of minimum votes required by Mr. Jani, M = 6
The votes casted are given below,
2
2
Got
1
3
There are only 5 unique votes, 1, 2, 3, 4 and 5. Mr. Jani required minimum 6 unique votes to
win so Ms. Ramya is the winner.
10
Transcribed Image Text:In the city of La La Land, the sports chief is to be elected Mr. Jani, who himself is a great athlete, is standing for the position. It looks like a cake for him but it is not so. Throughout his career, he has been involved in many controversies and because of this the people are divided. To challenge him, Ms. Ramya has also submitted her application. She is a fierce lady with a great track record but is considered too strict with her discipline norms. There are multiple departments in the sports authority. On the election day, each department is provided with an integer. It also means multiple persons from the same department have the same integer. Election Rules: 1. Different persons belonging to the same department, have the same integer. 2. Multiple votes with the same integer will be considered as a single unique vote 3 To win, Mr. Jani should have atleast M unique votes If not, then, Ms. Ramya will be elected as the Chief Officer. Note: If there are 3 people belonging to one department having an integer 5 and they all vote, then it will be considered as a single unique vote Now on election day Merenta hai Example: Number of people who casted their vote, N = 10 Number of minimum votes required by Mr. Jani, M = 6 The votes casted are given below, 2 2 Got 1 3 There are only 5 unique votes, 1, 2, 3, 4 and 5. Mr. Jani required minimum 6 unique votes to win so Ms. Ramya is the winner. 10
Input Format
The first line of input consists of number of test cases, T
The first line of each test case consists of two space separated integers, N and M
The second line of each test case consists of N space-separated integers.
Constraints
1<=T<100
1 N 10000
0<M<N
1<= Ni <=10000
Output Format
For each test case, print JANI if Mr. Jani wins otherwise print RAMYA. The output is case
sensitive
Sample TestCase 1
Input
2
106
1214113115
63
123421
Output
RAMYA
JANI
Explanation
Test Case 1: As explained in the example.
Test Case 2: Minimum unique votes required by Mr. Jani is 3. The number of unique votes
casted is 4 (1,23 and 4). The winner is Mr. Jani.
Time Limit():
Memory Limit:
-0.50 sec(s) for each input
512 MB
Transcribed Image Text:Input Format The first line of input consists of number of test cases, T The first line of each test case consists of two space separated integers, N and M The second line of each test case consists of N space-separated integers. Constraints 1<=T<100 1 N 10000 0<M<N 1<= Ni <=10000 Output Format For each test case, print JANI if Mr. Jani wins otherwise print RAMYA. The output is case sensitive Sample TestCase 1 Input 2 106 1214113115 63 123421 Output RAMYA JANI Explanation Test Case 1: As explained in the example. Test Case 2: Minimum unique votes required by Mr. Jani is 3. The number of unique votes casted is 4 (1,23 and 4). The winner is Mr. Jani. Time Limit(): Memory Limit: -0.50 sec(s) for each input 512 MB
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY