Maximum of a list

The maximum of a list t is the largest element that it contains. For
example, the maximum of [1, 2, 3] is 3, the maximum of [1, [2, 3], 4] is
4, and the maximum of [[[1]]] is 1. The maximum of [] is defined to be
0.

Write a program that prints the maximum of every given list.

Define and use a recursive function

    maximum(t)

that returns the maximum of a list t.

Hint

Using the @ast@ package, you can extract the list t encoded in a string
s with @t = ast.literal_eval(s)@.

Input

The input consists of several lists of non-negative numbers.

Output

Print the maximum of every given list.

Problem information

Author: Gabriel Valiente

Generation: 2026-01-25T15:56:18.131Z

© Jutge.org, 2006–2026.
https://jutge.org
