Олимпиадный тренинг

Задача 34808. Maximum number - 1


Задача

Темы: Цикл for
Given a natural number n and integers a1, a2, ..., an. Find the number of the maximum number divisible by 3. If there are several numbers with the maximum value divisible by 3, then the number of the last of them must be found (it is guaranteed that there is at least one number divisible by 3).

Input: in the first line enter the number N - the number of numbers in the sequence (0<N<100), and then N integers.
Output: print the answer to the problem

Examples
# Input Output
1 7
4
9
6
-3
-4
9
-2
6
 
 
Запрещенные операторы:list;[