Finding Privacy
시간 제한0.5초메모리 제한2048 MB
일렬로 놓인 N개의 변기에 K명을 배치해 각자가 양옆이 빈 변기를 고르고, 그 뒤에는 양옆이 빈 변기가 남지 않도록 만든 뒤 배치를 출력하거나 *를 출력한다.
문제
You surely agree that the best place to use a restroom is at home. However, sometimes people have no choice but to use a public restroom, where toilets are often arranged side by side in a single row. Aiming for some privacy, each person who enters such restroom will choose an unoccupied toilet that has no occupied toilets on its sides.
Suppose that people arrive at a public restroom with initially unoccupied toilets arranged in a row. Determine if it’s possible that each of the people chooses a toilet with no occupied toilets on its sides, and an additional person would not be able to find an unoccupied toilet meeting this privacy condition. People choose toilets one by one, and each chosen toilet is immediately occupied before the next person is allowed to choose.
입력
The input consists of a single line that contains two integers and (), indicating respectively the number of people and the number of toilets.
출력
Output a single line with a string of length if the people can choose toilets in a way that prevents an additional person from finding an available toilet with the required privacy. In this case the -th character of the string must be the uppercase letter “X” if the -th toilet is chosen, and the character “-” (hyphen) otherwise. Toilets are chosen as it is described in the statement. If there are multiple solutions, output any of them.
If toilets cannot be chosen as requested, output a line with the character “*” (asterisk) instead.