#C751. Maximum Tree Sweetness

    ID: 51389 Type: Default 1000ms 256MiB

Maximum Tree Sweetness

Maximum Tree Sweetness

In this problem, you are given several trees, each bearing a number of fruits. Each fruit has an associated sweetness value. The overall sweetness of a tree is determined by summing the sweetness values of all its fruits. Your task is to determine the maximum total sweetness among all the trees.

For instance, if you have a tree with fruits having sweetness values of 4, 5, and 6, then its total sweetness is 15. You may be given multiple trees and need to output the maximum total sweetness among them.

inputFormat

The input is read from stdin and has the following format:

  • The first line contains an integer n representing the number of trees.
  • Each of the next n lines begins with an integer m, indicating the number of fruits on that tree, followed by m space-separated integers which represent the sweetness values of these fruits.

outputFormat

Output a single integer to stdout, which is the maximum total sweetness among all the trees.

## sample
1
3 4 5 6
15