#P9048. [PA 2021] Zakłócenia

    ID: 9752 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 难度: 3 上传者: 标签>贪心2021Special Judge构造PA(波兰)

[PA 2021] Zakłócenia

Problem Description

Define a mapping from lowercase letters to 8-bit binary strings:

  • Convert the ASCII code of a lowercase character into an 8-bit binary number. For example: a9701100001a \rightarrow 97 \rightarrow 01100001.

Now A has a string ss of length nn that contains only lowercase letters. He maps this string into a binary string tt of length 8n8n.

He shuffles the binary string tt and gets another binary string tt'. Please restore one possible ss based on the shuffled result.

Input Format

The first line contains an integer nn.

The second line contains a binary string tt' of length 8n8n.

Output Format

If there is a solution, output one line containing a string ss of length nn consisting only of lowercase letters. Otherwise, output NIE.

If there are multiple solutions, output any one of them.

2
1100000011110111
ao
8
1011111010101100011011011010001010100011111111110001001001011010

potyczki
1
00011000
NIE

Hint

For 100%100\% of the testdata, 1n1051 \leq n \leq 10^5.

Translated by ChatGPT 5