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

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;
}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值