Virtual Reality Playspace
시간 제한4초메모리 제한2048 MB
장애물이 있는 격자에서 각 변이 벽이나 장애물에 닿고 두 변의 길이가 s, t 이상인 빈 직사각형의 개수를 센다.
문제
Yolanda just finished moving the furniture around her house. Her house is shaped like a rectangle of side lengths and . Yolanda wants to choose a place to put her virtual reality (VR) playspace.
Yolanda has some standards for how a VR playspace should be positioned:
- It should take the shape of a rectangle.
- Its sides should be parallel and perpendicular to the sides of her house.
- It must exactly cover the entirety of any unit square it occupies.
- It should contain no obstacles.
- It should be at least units across along one side, and at least units across along the other.
- Each of its sides must border either the house’s outer walls, or obstacles. In other words, a VR playspace is maximally-sized.
Given a map of Yolanda’s house, Yolanda wants to know how many different places she can choose for her VR playspace.
입력
The first line of input contains four integers , , , and (), giving the length and width of Yolanda’s house and the size of her VR playspace.
The next lines each contain a string of characters describing Yolanda’s house. Each character is either a dot (.) that denotes an empty square unit of space, or a zero (0) that denotes a square unit of obstacle.
출력
Output a single integer, the number of different places Yolanda can choose for her VR playspace.