13165 - GEC1506-top or min   

Description

Given a list of numbers and an indicator,

you need to find out the maximum or minimum number in the list according to the indicator.

Input

There is only one line in the input, which contains the list of numbers and the indicator.

An example is shown below.

9,0,21,i1,61,66,91,62,83,22,22

Note that

  1. The red element in the line is the indicator where you can find it with the character "i" and the following digit is the indicator. (1 in this example). When you meet indicator 1, you need to find the maximum; and 2 to find the minimum.
  2. The remaining blue elements are the numbers of the list of numbers.

Hint:

x = [1, 2, 3, 4, 5]

print( min(x))# output: 1

print( max(x)) # output: 5

Output

The output is a line of text with the maximum/minimum number from the list.

Sample Input  Download

Sample Output  Download

Tags




Discuss