codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

1028B.md (988B)


      1 Source: https://codeforces.com/problemset/problem/1028/B
      2 
      3 B. Unnatural Conditions
      4 
      5 time limit per test
      6 
      7 1 second
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 standard input
     16 
     17 output
     18 
     19 standard output
     20 
     21 Let $s(x)$ be sum of digits in decimal representation of positive integer $x$. Given two integers $n$ and $m$, find some positive integers $a$ and $b$ such that
     22 
     23 * $s(a) \ge n$,
     24 * $s(b) \ge n$,
     25 * $s(a + b) \le m$.
     26 
     27 Input
     28 
     29 The only line of input contain two integers $n$ and $m$ ($1 \le n, m \le 1129$).
     30 
     31 Output
     32 
     33 Print two lines, one for decimal representation of $a$ and one for decimal representation of $b$. Both numbers must not contain leading zeros and must have length no more than $2230$.
     34 
     35 Examples
     36 
     37 Input
     38 
     39 ```
     40 6 5
     41 ```
     42 
     43 Output
     44 
     45 ```
     46 6   
     47 7
     48 ```
     49 
     50 Input
     51 
     52 ```
     53 8 16
     54 ```
     55 
     56 Output
     57 
     58 ```
     59 35   
     60 53
     61 ```
     62 
     63 Note
     64 
     65 In the first sample, we have $n = 6$ and $m = 5$. One valid solution is $a = 6$, $b = 7$. Indeed, we have $s(a) = 6 \ge n$ and $s(b) = 7 \ge n$, and also $s(a + b) = s(13) = 4 \le m$.