Maximum and minimum
Problem
Given a sequence of non-zero integers ending in zero (zero is not included in the sequence). It is necessary to find the distance (modulo) between the first minimum and the first maximum number of the sequence.
Input: integers (one number per line) are input
Output: print the answer to the problem
Example
№ |
Input |
Output |
1 |
-1
-2
1
7
2
0 |
2 |
Запрещенные операторы: list
; [
; max
; min