CF659C.Tanya and Toys

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

In Berland recently a new collection of toys went on sale. This collection consists of 10910^{9} types of toys, numbered with integers from 11 to 10910^{9} . A toy from the new collection of the ii -th type costs ii bourles.

Tania has managed to collect nn different types of toys a1,a2,...,ana_{1},a_{2},...,a_{n} from the new collection. Today is Tanya's birthday, and her mother decided to spend no more than mm bourles on the gift to the daughter. Tanya will choose several different types of toys from the new collection as a gift. Of course, she does not want to get a type of toy which she already has.

Tanya wants to have as many distinct types of toys in her collection as possible as the result. The new collection is too diverse, and Tanya is too little, so she asks you to help her in this.

输入格式

The first line contains two integers nn ( 1<=n<=1000001<=n<=100000 ) and mm ( 1<=m<=1091<=m<=10^{9} ) — the number of types of toys that Tanya already has and the number of bourles that her mom is willing to spend on buying new toys.

The next line contains nn distinct integers a1,a2,...,ana_{1},a_{2},...,a_{n} ( 1<=ai<=1091<=a_{i}<=10^{9} ) — the types of toys that Tanya already has.

输出格式

In the first line print a single integer kk — the number of different types of toys that Tanya should choose so that the number of different types of toys in her collection is maximum possible. Of course, the total cost of the selected toys should not exceed mm .

In the second line print kk distinct space-separated integers t1,t2,...,tkt_{1},t_{2},...,t_{k} ( 1<=ti<=1091<=t_{i}<=10^{9} ) — the types of toys that Tanya should choose.

If there are multiple answers, you may print any of them. Values of tit_{i} can be printed in any order.

输入输出样例

  • 输入#1

    3 7
    1 3 4
    

    输出#1

    2
    2 5 
    
  • 输入#2

    4 14
    4 6 12 8
    

    输出#2

    4
    7 2 3 1
    

说明/提示

In the first sample mom should buy two toys: one toy of the 22 -nd type and one toy of the 55 -th type. At any other purchase for 77 bourles (assuming that the toys of types 11 , 33 and 44 have already been bought), it is impossible to buy two and more toys.

首页