Hide

Problem A
Maximum Number

Accepted submissions to this problem will be granted a score of 100

Design an algorithm that finds the maximum positive integer input by a user.

The user repeatedly inputs numbers until a negative value is entered.

Input

Input consists of n2 lines. Line i contains one integer, ai, where 0ai10000 for all i<n, and 10000an<0.

Output

Output consists of one integer, the maximum integer input.

Sample Input 1 Sample Output 1
5
7
2
4
9
11
8
-1
11
Sample Input 2 Sample Output 2
21
19
16
46
78
23
99
34
23
-5
99
Hide

Please log in to submit a solution to this problem

Log in