#C7626. Maximum Single-Day Pastry Production

    ID: 51518 Type: Default 1000ms 256MiB

Maximum Single-Day Pastry Production

Maximum Single-Day Pastry Production

Given the daily production records of different pastry types for a month, you are to determine the maximum quantity produced for any single pastry type on any single day.

For each day, you are provided with a list of production records. Each record is a pair in the form \( (id, quantity) \), where id represents the pastry type and quantity represents the number of pastries produced of that type on that day.

Your task is to compute the maximum \( quantity \) across all days and all pastry types.

inputFormat

The input is provided via standard input (stdin) with the following format:

N
M1 id1 quantity1 id2 quantity2 ... idM1 quantityM1
M2 id1 quantity1 id2 quantity2 ... idM2 quantityM2
...
MN id1 quantity1 id2 quantity2 ... idMN quantityMN

Where:

  • N is an integer representing the number of days in the month.
  • For each day, the first integer M indicates the number of pastry production records for that day.
  • Each record consists of two integers: id (pastry type) and quantity (the quantity produced).
  • </p>

    outputFormat

    Output a single integer to standard output (stdout): the maximum quantity produced in a single record across all days.

    ## sample
    4
    2 1 100 2 200
    3 1 150 3 50 4 300
    1 2 450
    2 1 50 2 100
    450