CF538B.Quasi Binary

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

A number is called quasibinary if its decimal representation contains only digits 0 or 1. For example, numbers 0, 1, 101, 110011 — are quasibinary and numbers 2, 12, 900 are not.

You are given a positive integer nn . Represent it as a sum of minimum number of quasibinary numbers.

输入格式

The first line contains a single integer nn ( 1<=n<=1061<=n<=10^{6} ).

输出格式

In the first line print a single integer kk — the minimum number of numbers in the representation of number nn as a sum of quasibinary numbers.

In the second line print kk numbers — the elements of the sum. All these numbers should be quasibinary according to the definition above, their sum should equal nn . Do not have to print the leading zeroes in the numbers. The order of numbers doesn't matter. If there are multiple possible representations, you are allowed to print any of them.

输入输出样例

  • 输入#1

    9
    

    输出#1

    9
    1 1 1 1 1 1 1 1 1 
    
  • 输入#2

    32
    

    输出#2

    3
    10 11 11 
    
首页