CF922F.Divisibility

提高+/省选-

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

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

题目描述

Imp is really pleased that you helped him. But it you solve the last problem, his gladness would raise even more.

Let's define for some set of integers as the number of pairs a, b in , such that:

  • a is strictly less than b;
  • a divides b without a remainder.

You are to find such a set , which is a subset of {1, 2, ..., n} (the set that contains all positive integers not greater than n), that .

Imp 非常高兴你帮助了他。但如果你能解决最后这个问题,他的喜悦之情将会更上一层楼。

我们定义 (其中 是某个整数集合),为满足如下条件的数对 (a,b)(a, b) 的个数(其中 a,b∈Sa, b \in S):

  • aa 严格小于 bb;
  • aa 能整除 bb(即 b mod a=0b \bmod a = 0)。

你需要找出一个集合 ,使得 S⊆{1, 2, …, n}S \subseteq \{1,\, 2,\, \dots,\, n\}(即 SS 是由所有不超过 nn 的正整数组成的集合的一个子集),且满足 。

输入格式

The only line contains two integers n and k .

唯一一行包含两个整数 nn 和 kk 。

输出格式

If there is no answer, print "No".

Otherwise, in the first line print "Yes", in the second — an integer m that denotes the size of the set you have found, in the second line print m integers — the elements of the set , in any order.

If there are multiple answers, print any of them.

如果没有答案,输出“No”。

否则,第一行输出“Yes”,第二行输出一个整数 mm,表示你所找到的集合 的大小;第三行输出 mm 个整数——即集合 的元素(顺序任意)。

若存在多个答案,输出其中任意一个即可。

输入输出样例

  • 输入#1

    3 3

    输出#1

    No
  • 输入#2

    6 6

    输出#2

    Yes
    5
    1 2 4 5 6
  • 输入#3

    8 3

    输出#3

    Yes
    4
    2 4 5 8

说明/提示

In the second sample, the valid pairs in the output set are (1, 2), (1, 4), (1, 5), (1, 6), (2, 4), (2, 6). Thus, .

In the third example, the valid pairs in the output set are (2, 4), (4, 8), (2, 8). Thus, .

在第二个样例中,输出集合中的有效对为 (1, 2)(1, 2)、(1, 4)(1, 4)、(1, 5)(1, 5)、(1, 6)(1, 6)、(2, 4)(2, 4)、(2, 6)(2, 6)。因此,。

在第三个样例中,输出集合中的有效对为 (2, 4)(2, 4)、(4, 8)(4, 8)、(2, 8)(2, 8)。因此,。

输入解题思路,AI测评打分。不知道怎么写?

首页