Hello again!! Hope you solved my problem of Mega Challenge. What answer did you get? Reply to me for checking. Meanwhile I have prepared another problem for you.
It is quite interesting.
NCS Circle Lounge
Problem
So, there is a ranking of NCS 2026 songs list going on. We are trying to figure out which NCS circle is the best of the year by average of each one. There are S songs in the year and each song has a R[i]th rating out of 100 and has the C[i]th circle color.
Goal??
You need to make a code that -
- Find out the average of each circle.
- Find the highest average.
- Output that color.
Input
- The first line will contain T - the number of test cases.
- The second line will contain S - the number of songs.
- The third line will contain a list R - the rating for each song.
- The fourth line will contain a list of C - the circle for each song.
Output
Output the color circle which has the maximum average.
Constraints
- 1 <= T <= 100
- 1 < S <= 50
- 0 <= R[i] <= 100
- It is guaranteed that no averages are equal.
Sample Input and Output
Input
Output
Hints
If you are having a hard time, use the hints below.
Hint 1
Instead of calculating the average every time you encounter a song, first collect all information for each color. What two values are enough to compute the average at the end?
Hint 2
For every color, maintain:
- the total sum of ratings,
- the number of songs.
After processing all songs, compute the average for each color and choose the maximum.
Hint 3
Group all songs by their circle color. For each color, keep track of the total rating and the number of songs. Once all songs are processed, computing the average for each color becomes straightforward.
Good luck on the problem!!! Reply to me if you got it or not, I’ll help you solve it.

