PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GD0000169. Polycarp ở đài phát thanh (Polycarp at the Radio)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Polycarp ở đài phát thanh (Polycarp at the Radio)

Polycarp at the Radio

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

A playlist has nn songs, with band ID aia_i for each song. Polycarp cares about bands 11 through mm. Changing the performer at one position costs one edit. First maximize the minimum frequency among these mm bands, then minimize the number of edits. Output an optimal playlist.

Input

The first line contains n,mn,m. The second contains nn integer band identifiers aia_i.

Output

Print the maximum minimum frequency and the minimum required number of edits. On the next line print the nn resulting band IDs.

Subtasks

  • Subtask 1 (20 points): 1≤m≤n≤81\le m\le n\le 8; 1≤ai≤1091\le a_i\le 10^9.
  • Subtask 2 (30 points): 1≤m≤n≤2001\le m\le n\le 200; 1≤ai≤1091\le a_i\le 10^9.
  • Subtask 3 (50 points): 1≤m≤n≤20001\le m\le n\le 2000; 1≤ai≤1091\le a_i\le 10^9.

Examples

Input

4 2
1 2 3 2

Output

2 1
1 2 1 2

Explanation

Each of bands 11 and 22 can receive two songs, reaching the upper bound ⌊4/2⌋=2\lfloor4/2\rfloor=2. Changing the third song from band 33 to band 11 gives [1,2,1,2][1,2,1,2], with counts 2,22,2 and only one edit; zero edits would leave band 11 underrepresented.