Skip to main content
LIVE CONTEST: Round #7 · Begin Marathon is live now! …

~/algor $ cat problems/array/elements-greater-than-the-previous

Elements greater than the previous

Author Iqbolshoh Ilhomjonov 3 @iqbolshoh 650 problems
Easy 1000 ms 128 MB 30%
Share

A positive integer and an array of integers are given. Print the number of elements strictly greater than their previous neighbour, and these elements themselves in input order.

Finding the array elements greater than their previous neighbour

Input

The first line contains a positive integer . The second line contains integers separated by spaces.

Output

The first line contains one integer — the number of such elements . If , the second line contains these elements separated by spaces (if there are no such elements, only is printed).

Note


Examples

Input #1
6
3 8 5 12 15 9
Output #1
3
8 12 15
Input #2
4
5 4 3 2
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.