欢迎来到起遇信息学
起遇信息学正处于上线筹建阶段,以下功能已全部开放免费体验: ✅ 完整题库浏览与代码提交评测(C / C++ / Python / Java 等) ✅ 入门到进阶的系列课程试读、作业与考试 ✅ AI 提示、AI 作业分析等智能助教功能 ✅ 赛事模拟与个人能力报告 ✅ 邮箱注册开放 ⏳ 付费课程订阅与微信/支付宝支付通道 ⏳ 手机号登录,微信扫码登录、微信公众号绑定 使用中如遇任何问题,欢迎通过页面底部 **"联系我们"** 与我们沟通。
CF1104A.Splitting into digits
Splitting into digits
Vasya has his favourite number . He wants to split it to some non-zero digits. It means, that he wants to choose some digits , such that for all and .
Vasya likes beauty in everything, so he wants to find any solution with the minimal possible number of different digits among . Help him!
Input
The first line contains a single integer — the number that Vasya wants to split ().
Output
In the first line print one integer — the number of digits in the partition. Note that must satisfy the inequality . In the next line print digits separated by spaces. All digits must satisfy the inequalities .
You should find a partition of in which the number of different digits among will be minimal possible among all partitions of into non-zero digits. Among such partitions, it is allowed to find any. It is guaranteed that there exists at least one partition of the number into digits.
Note
In the first test, the number can be divided into digit equal to .
In the second test, there are partitions of the number into digits in which the number of different digits is . This partitions are , and . Any of these partitions can be found. And, for example, dividing the number to the digits isn't an answer, because it has different digits, that isn't the minimum possible number.
Samples
1
1
1
4
2
2 2
27
3
9 9 9
在线编程 IDE
建议全屏模式获得最佳体验
| 进入全屏编程 | Alt+E |
| 递交评测 | Ctrl+Enter |
| 注释/取消注释 | Ctrl+/ |
| 缩放字体 | Ctrl+滚轮 |