Cheese Touch
면접 대비시간 제한2초메모리 제한2048 MB
건강한 사람, 감염자, 벽으로 이루어진 1차원 배열에서 p분마다 감염이 인접 칸으로 퍼질 때, t분에 도착하는 치료제가 모든 건강한 사람이 감염되기 전에 오는지 판정한다.
문제
Colorado School of Mines has a big problem! Somebody left a piece of cheese in front of the Student Center, and now several students are infected with the "cheese touch". These infected students can spread it to anyone adjacent to them, but not through walls. Although a cure is being developed, it may not come fast enough to stop the spread.
The "cheese touch" spreads every minutes (at times ), infecting people directly adjacent to infected individuals. The cure will be ready after minutes. The cure acts immediately, so the infection is not spread at time or any time after.
입력
The first line of input contains two integers () and () representing the minutes it takes for the "cheese touch" to spread and the minutes it takes to find a cure, respectively.
The second line contains a single string () consisting of the characters 'H', 'I', and 'W' representing the initial configuration of Healthy people, Infected people, and Walls, respectively. It is guaranteed that there will be at least healthy person.
출력
Print out "CURED" if the cure was released before all the healthy people became infected or "ALL INFECTED" if the cure came too late (without quotes).