Let s(x)s(x) be sum of digits in decimal representation of positive integer xx. Given two integers nn and mm, find some positive integers aa and bb such that

  • s(a)≥ns(a)≥n,
  • s(b)≥ns(b)≥n,
  • s(a+b)≤ms(a+b)≤m.

Input

The only line of input contain two integers nn and mm (1≤n,m≤11291≤n,m≤1129).

Output

Print two lines, one for decimal representation of aa and one for decimal representation of bb. Both numbers must not contain leading zeros and must have length no more than 22302230.

Examples

input

Copy

6 5

output

Copy

6
7

input

Copy

8 16

output

Copy

35
53

Note

In the first sample, we have n=6n=6 and m=5m=5. One valid solution is a=6a=6, b=7b=7. Indeed, we have s(a)=6≥ns(a)=6≥n and s(b)=7≥ns(b)=7≥n, and also s(a+b)=s(13)=4≤ms(a+b)=s(13)=4≤m.

这道题一开始我想着是暴力的 后来看翻译才知道数字长短在2230范围内 然后看别人的代码 然后发现这是一道思维题。。哎 自己太笨了 然后就直接上代码吧 智商需要充值了。。

#include <cstring>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string.h>
#include <map>
#define ll long long
using namespace std;
#define pai acos(-1,0)
int main()
{int n,m;cin>>n>>m;for(int i=1;i<=2230;i++)cout<<8;cout<<endl;for(int i=1;i<=2229;i++)cout<<1;cout<<2;cout<<endl;return 0;
}

CF AIM Tech Round 5 (rated, Div. 1 + Div. 2) B. Unnatural Conditions 思维 ʕ •ᴥ•ʔ相关推荐

  1. AIM Tech Round 4 (Div. 2)ABCD

    这一场真的是血崩,a,b都被hack,还好结束前重交都过了 A:题意:找出得到k个不同的字符,所要更改的最小字符数 题解:首先如果k>字符串长度,直接impossible,然后直接记录一下不重复 ...

  2. AIM Tech Round 3 (Div. 2) A B C D

    虽然打的时候是深夜但是状态比较好 但还是犯了好多错误..加分场愣是打成了降分场 ABC都比较水 一会敲完去看D 很快的就想出了求0和1个数的办法 然后一直wa在第四组..快结束的时候B因为低级错误被h ...

  3. AIM Tech Round 4 (Div. 2)

    A题 分析:暴力 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" ...

  4. AIM Tech Round (Div. 1) C. Electric Charges 二分

    C. Electric Charges 题目连接: http://www.codeforces.com/contest/623/problem/C Description Programmer Sas ...

  5. cf Educational Codeforces Round 85 (Rated for Div. 2)B. Middle Class

    题目链接:https://codeforces.com/contest/1334/problem/B B. Middle Class time limit per test2 seconds memo ...

  6. AIM Tech Round 5C. Rectangles 思维

    C. Rectangles time limit per test 2 seconds memory limit per test 256 megabytes input standard input ...

  7. 【CF比赛】Educational Codeforces Round 102 (Rated for Div. 2)

    题目来源 Educational Codeforces Round 102 (Rated for Div. 2) A. Replacing Elements 只要判断最大值是否小于等于d,或者第一个值 ...

  8. Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)切题报告(A-B题)

    这是我第二次参加CF比赛,也是第一次写博客,写得不好,望各位大佬海涵. A. Single Wildcard Pattern Matching 原题链接 这道题,这是难到让人无法直视,太水了. 题目大 ...

  9. Educational Codeforces Round 138 (Rated for Div. 2)-赛后总结

    Dashboard - Educational Codeforces Round 138 (Rated for Div. 2) - Codeforces 总结一个教训就是不要心急,特别是对于一些题目, ...

最新文章

  1. python凹多边形分割_使用Opencv python从Image中裁剪凹面多边形
  2. Python3 MySQL 数据库连接 - PyMySQL 驱动
  3. [content-description] find_element_by_accessibility_id 在 android 中的详解
  4. HTML学习03之列表,表格,媒体元素
  5. 深度学习:tensorflow层次结构,朴素NN代码实现tensorflow
  6. 【Tiny4412】烧写最小文件系统到SD卡
  7. Protocol Buffers的应用与分析
  8. linux基础操作与实践,Linux操作系统基础与实践
  9. xhell 镜像_2020官网下载Xshell 6.0.189.0中文版
  10. [CF452E]Three strings
  11. Expm 1_2 实现快速排序的算法,并尝试采用不同的方法实现线性的划分过程.
  12. springboot修改项目不需要重启服务器
  13. 【C/C++ 】C++库类大全
  14. C++使用万能头文件报错
  15. ffmpeg 的下载安装
  16. 冯诺依曼机器人_人工智能 | 从智能家电到机器人,从谷歌大脑到人类
  17. 学好Python的优秀资源推荐
  18. MySQL基础学习2
  19. 线上线下协同发展,020 商业解析
  20. 基于docker安装的rabbitmq如何安装rabbitmq_delayed_message_exchange-3.8.0.ez插件

热门文章

  1. 古文观止卷七_陋室銘_劉禹錫
  2. Unity3d-learning 牧师与恶魔
  3. 3DMX电子沙盘和虚拟互动沙盘教程第32课 如何导入和呈现3DMAX模型
  4. 3dmx软件工作灵活,易学易用,制作效率极高,渲染真实感极强
  5. 明日方舟抽卡模拟器wiki_明日方舟tag模拟器wiki
  6. 我的世界服务器怎么注册邮箱,我的世界端游如何注册账号,我的世界如何绑定账号...
  7. [清华集训2012]串珠子
  8. 安装和配置Postfix
  9. 测试酒的真假软件,如何鉴定真假酒?实验人员用便携式黑科技几秒钟出结果
  10. html5简单姓名页面代码,几个简单但是非常有用的HTML5代码