QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 512 MB Total points: 100 Difficulty: [show]

#1875. Нет

Statistics

Даны $k$ и $n$. Найдите $n$-е по возрастанию положительное целое число $x$, для которого десятичная запись $x\cdot\underbrace{999\ldots9}_{k}$ не содержит ни одной цифры $9$.

Входные данные

Единственная строка содержит два целых числа $k$ и $n$ ($1\le k\le18$, $1\le n\le10^{18}$).

Выходные данные

Выведите ответ.

Примеры

Входные данные 1

1 1

Выходные данные 1

2

Входные данные 2

1 8

Выходные данные 2

9

Входные данные 3

1 9

Выходные данные 3

12

Входные данные 4

1 10

Выходные данные 4

13

Входные данные 5

5 1

Выходные данные 5

11112

Входные данные 6

5 84

Выходные данные 6

11235

Входные данные 7

5 668

Выходные данные 7

12345

Входные данные 8

5 733942

Выходные данные 8

2281488

Примечание

При $k=1$ последовательность всех допустимых чисел начинается с $2,3,4,5,6,7,8,9,12,13,\ldots$.

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#548Editorial Open集训队作业 解题报告 by 朱鹏睿Qingyu Download

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.