Party Finding Minions Lege
Simple Party Finding
Minions Legends is a multiplayer online battle arena (MOBA) mobile game. In this game, each player will be grouped with another player to form a team. The team will fight another team to defend their sacred ancient and to destroy their opponent’s base.
In the next patch, the developers of the game want to create a simple party finding
Format Input
The first line contains integer K which denote as the number of cases. The second line contains integer N stating the total number of players. Then, the third line consists of N MMR in the game. Lastly, the fourth line contains of F which denote as the player’s MMR who wants to find a party. It is guaranteed that the MMR are distinct.
Format Output
Output with a format “CASE #K: [MMR 1] [MMR 2]”; where MMR 1 and MMR 2 are the result of party finding. Note that MMR 1 is the one with the lower MMR compared to MMR 2. If the inputted MMR’s number is not in the list of players, give an output “CASE #K: -1 -1”.
Constraints
• 1 ≤ K ≤ 100
• 2 ≤ N ≤ 1000
• 3000 ≤ MMR ≤ 9999
• 3000 ≤ F ≤ 9999
Sample Input 1 (standard input)
3
10
3246 4255 4873 5004 5095 6001 6692 7100 7610 9712
9712
8
4957 5444 5464 5634 6149 6622 8313 9492
4957
6
5393 6021 7233 8115 8118 9304
9999
Sample Output 1 (standard output)
CASE #1: 7610 9712
CASE #2: 4957 5444
CASE #3: -1 -1
NOTES : In C Language
Use basic code, dont use return, void, ect.
Dont Use Stdlib.h library, use basic code
Pay attention to constraints
Step by step
Solved in 2 steps with 5 images