CF339C.Xenia and Weights

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

Xenia has a set of weights and pan scales. Each weight has an integer weight from 1 to 10 kilos. Xenia is going to play with scales and weights a little. For this, she puts weights on the scalepans, one by one. The first weight goes on the left scalepan, the second weight goes on the right scalepan, the third one goes on the left scalepan, the fourth one goes on the right scalepan and so on. Xenia wants to put the total of mm weights on the scalepans.

Simply putting weights on the scales is not interesting, so Xenia has set some rules. First, she does not put on the scales two consecutive weights of the same weight. That is, the weight that goes ii -th should be different from the (i+1)(i+1) -th weight for any ii (1<=i<m) . Second, every time Xenia puts a weight on some scalepan, she wants this scalepan to outweigh the other one. That is, the sum of the weights on the corresponding scalepan must be strictly greater than the sum on the other pan.

You are given all types of weights available for Xenia. You can assume that the girl has an infinite number of weights of each specified type. Your task is to help Xenia lay mm weights on ​​the scales or to say that it can't be done.

输入格式

The first line contains a string consisting of exactly ten zeroes and ones: the ii -th (i>=1)(i>=1) character in the line equals "1" if Xenia has ii kilo weights, otherwise the character equals "0". The second line contains integer mm (1<=m<=1000)(1<=m<=1000) .

输出格式

In the first line print "YES", if there is a way to put mm weights on the scales by all rules. Otherwise, print in the first line "NO". If you can put mm weights on the scales, then print in the next line mm integers — the weights' weights in the order you put them on the scales.

If there are multiple solutions, you can print any of them.

输入输出样例

  • 输入#1

    0000000101
    3
    

    输出#1

    YES
    8 10 8
    
  • 输入#2

    1000000000
    2
    

    输出#2

    NO
    
首页