#C7091. Country with Most Denominations
Country with Most Denominations
Country with Most Denominations
You are given data about several countries and their coin denominations. The first line of the input contains an integer n representing the number of countries. For each country, the input consists of:
- An integer k indicating the number of coin denominations collected.
- A line containing the country's name.
- k lines, each representing a coin denomination.
Your task is to determine the country with the most coin denominations. If more than one country has the same highest number of denominations, output the country that appears first in the input.
You can mathematically represent the problem as finding the index i such that:
$$\max\{k_1, k_2, \ldots, k_n\}$$with ties broken by the smallest index.
inputFormat
The input is read from stdin
and is structured as follows:
- The first line contains an integer n ($1 \le n \le 100$), the number of countries.
- For each country, the following lines are provided:
- A line with an integer k ($1 \le k \le 100$), the number of denominations.
- A line with the country's name.
- k lines each containing a coin denomination.
outputFormat
Output to stdout
a single line containing the name of the country with the most coin denominations. If there is a tie, output the name of the country that appeared first in the input.
3
3
Japan
1-yen
5-yen
10-yen
2
Canada
1-dollar
2-dollar
3
Germany
1-euro
2-euro
50-euro
Japan