| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 (추가 시간 없음) | 2048 MB (추가 메모리 없음) | 123 | 52 | 40 | 39.216% |
Sick of solving geometry problems, you decide to solve the following constructive problem: find a string of length $n$ that contains exactly $k$ not necessarily contiguous subsequences of NAC.
This problem seems too familiar though. Here's the twist - your friend has given you part of the string, so you must fill in the remaining characters!
The first line of input contains two integers $n$ (1ドル \le n \le 40$) and $k$ (0ドル \le k \le 2,500円$), where $n$ is the length of the string and $k$ is the number of not necessarily contiguous subsequences of NAC that the output must contain.
The second line contains a string of length exactly $n,ドル consisting only of uppercase letters and/or question marks.
Output a string of upper case letters, replacing each question mark in the input string with an uppercase letter so that the resulting string has exactly $k$ subsequences of NAC. If this is not possible, output -1. Any uppercase letters in the input string must be kept in their position. There may be multiple possible solutions for any given test case; any correct solution will be accepted.
22 2 N??A??????C???????????
NOTANOTHERCONSTRUCTIVE
18 0 COUNTINGSATELLITES
COUNTINGSATELLITES
2 1 ??
-1