#CCBCHBAHAI0000044. Loại các phần tử ở chỉ số chẵn (Remove Elements at Even Indices)
Loại các phần tử ở chỉ số chẵn (Remove Elements at Even Indices)
Loại các phần tử ở chỉ số chẵn (Remove Elements at Even Indices)
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem
Given an integer array using 0-based indexing.
Remove every element whose original index is even, i.e. every satisfying
Elements at original odd indices keep their relative order. Thus the result is
up to the last valid index below .
Print the new size and the resulting array.
Input
The first line contains integer . The second line contains exactly integers .
Output
Print the new size on the first line. If , print the elements from original odd indices on the second line.
Subtask
Subtask 1 (100 points): ; .
Example
Input
7
10 20 30 40 50 60 70
Output
3
20 40 60
Explanation
The original odd indices are , containing . Indices are interpreted in the original array, not recomputed after each deletion.