#K52867. Maximum Book Identifier
Maximum Book Identifier
Maximum Book Identifier
You are given a set of books, each having a unique identifier. The books are arranged in an arbitrary order. Your task is to find the book with the maximum identifier. If the list of books is empty, output 0.
Note: The input will be provided through standard input (stdin) and the output should be printed to standard output (stdout).
Mathematical Formulation: Given an integer \( n \) and a sequence of \( n \) integers \( b_1, b_2, \dots, b_n \), find \( \max_{1 \le i \le n} b_i \). If \( n = 0 \), output \( 0 \).
inputFormat
The first line contains a single integer \( n \) representing the number of books. The second line contains \( n \) space-separated integers representing the book identifiers.
If \( n = 0 \), the second line may be empty.
outputFormat
Output a single integer which is the maximum book identifier from the given list. In the case of an empty list (i.e., when \( n = 0 \)), output 0.
## sample5
1 5 3 8 6
8