[문제 요약] 다음과 같은 지하철 상태도가 주어진다.
L 과 같은 거리(유클리디언 거리...직선거리)에 있는 X 는 서로 다툼이 발생한다. 다툼이 일어날 수 있는 쌍의 수를 구하는 문제
단, X 에서 같은 거리에 있는 L 은 입력으로 주어지지 않는다.
Problems arise when two or more such individuals aim for the same spot. If one of them is the closest, he or she will sit, and others won't event attempt to move in and instead turn their attention to the next closest spot. If however they are all equally close, they will all run to the seat resulting in a massive explosion that usually ends with complete destruction of both them and the seat.
You are given a description of one tram. It is represented as a table with R rows and C columns. The rude passengers are marked with the letter 'X'. Empty seats are marked with 'L' and the tram floor is marked with '.'.
Note that although there are other passengers, the force projected by these idiots is more than enough to simply walk through them. Distance between two cells is the Euclid distance between their centers. Write a program that will determine the number of explosions which will take place before all people are seated, or destroyed, or they run out of chairs.
입력 4 4 .LX. .X.. .... .L.. 출력 1 입력 4 4 .XLX .X.. ...L .X.. 출력 2 입력 7 7 ...X.X. XL....L ....... ...L... .....XL ....... ...X... 출력 1
출처:coci