The smallest even
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Given an array of n integers, your task is to find the smallest even element. You should output the index of this smallest even element along with its value. If there are multiple smallest even elements, choose the one with the lowest index. If the array contains no even numbers, output NO. The array is zero-indexed.
Input
The first line contains the integer n (1 ≤ n ≤ 100), representing the number of elements in the array. The second line contains n integers, each with an absolute value not exceeding 100.
Output
Print two numbers on one line: the index of the smallest even element and its value. If there are no even elements in the array, print NO.
Examples
Input #1
Answer #1
Submissions 488
Acceptance rate 27%