CF489C.Given Length and Sum of Digits...

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

You have a positive integer mm and a non-negative integer ss . Your task is to find the smallest and the largest of the numbers that have length mm and sum of digits ss . The required numbers should be non-negative integers written in the decimal base without leading zeroes.

输入格式

The single line of the input contains a pair of integers mm , ss ( 1<=m<=100,0<=s<=9001<=m<=100,0<=s<=900 ) — the length and the sum of the digits of the required numbers.

输出格式

In the output print the pair of the required non-negative integer numbers — first the minimum possible number, then — the maximum possible number. If no numbers satisfying conditions required exist, print the pair of numbers "-1 -1" (without the quotes).

输入输出样例

  • 输入#1

    2 15
    

    输出#1

    69 96
    
  • 输入#2

    3 0
    

    输出#2

    -1 -1
    
首页