atcoder#ABC275C. [ABC275C] Counting Squares
[ABC275C] Counting Squares
Score : points
Problem Statement
There is a two-dimensional plane. For integers and between and , there is a pawn at the coordinates if the -th character of is #
, and nothing if the -th character of is .
.
Find the number of squares in this plane with pawns placed at all four vertices.
Constraints
- Each of is a string of length consisting of
#
and.
.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
##.......
##.......
.........
.......#.
.....#...
........#
......#..
.........
.........
2
The square with vertices , , , and have pawns placed at all four vertices.
The square with vertices , , , and also have pawns placed at all four vertices.
Thus, the answer is .
.#.......
#.#......
.#.......
.........
....#.#.#
.........
....#.#.#
........#
.........
3