#CCBCHBAHAI0000038. Xóa phần tử tại vị trí p (Delete the Element at Position p)
Xóa phần tử tại vị trí p (Delete the Element at Position p)
Xóa phần tử tại vị trí p (Delete the Element at Position p)
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem
Given an integer array of logical size :
Given an index satisfying
Delete . The new size is . For every :
$$b_i= \begin{cases} a_i, & i<p,\\ a_{i+1}, & i\ge p. \end{cases}$$Print the new size and the remaining array.
Input
The first line contains integers . The second line contains integers .
Output
Print on the first line. If , print the remaining elements on the second line.
Subtask
Subtask 1 (100 points): ; ; .
Example
Input
5 2
10 20 30 40 50
Output
4
10 20 40 50
Explanation
The element is deleted; 40 and 50 shift one position to the left.