Raman is a former. He wants to buy some pipes of distinct sizes . There were N pipes in the shop and some of them are of same size. The size of the pipe has been marked on the pipe using some number nums in the form of bar code. Can you write a program that scans all the bar codes and print number of pipes Raman can get from that shop.
Raman is a former. He wants to buy some pipes of distinct sizes . There were N pipes in the shop and some of them are of same size. The size of the pipe has been marked on the pipe using some number nums in the form of bar code. Can you write a program that scans all the bar codes and print number of pipes Raman can get from that shop.
Read the input
from STDIN and write output to STDOUT . You should not write arbitrary strings
while reading the input.
Input format:
The first
line of input contains N
The second line
of input contains N pipes separated by a single white space in ascending order
Output format:
The first
line of output contains number of pipes after scanning all bar codes
The second
line of output contains pipe sizes after scanning.
Sample input:
3
1 1 2
Sample output:
2
1 2
Sample Input2:
10
0 0 1 1 1 2
2 3 3 4
Sample output 2
5
0 1 2 3 4
0 Comments
Post a Comment