HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Winner's Camp > problem:


10. 50475 - Voice advertising

Guest
• Discussion of problem (1)

Volume problems

• 06. 50714 - The knight
• 12. 50723 - Tribonacci
• 04. 50649 - Puzzle
• 01. 50722 - Scientist's problem
• 02. 50376 - Sequences
• 05. 50713 - Castle and the girls
• 08. 50370 - Number of rectangles in ...
• 09. 50716 - All Palindromes
• 10. 50475 - Voice advertising
• 11. 50476 - Meditation
• 07. 50715 - Zero Sum

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
National Olympiads in Montenegro. Difficulty Beta

Voice advertising

One sector in a soccer stadium has a rectangle shape with H rows and W seats in each row. Some seats are empty and some are filled with soccer fans. During the game, fans shout different slogans. It goes as follows:

If fan A from one seat starts shouting, then fans sitting on his left, right, up, and down do the same. Then, the neighbors of these do the same, and so on.  A sponsor of the soccer team would like that the fans "spontaneously" shout the slogan of his company. They have hired Mirko to sit on a free seat and starts shouting the slogan of the company. A sponsor aims that the number of people who shout their slogan is as large as possible.  Your duty is to help out Mirko to pick a seat that will allow him to induce a shout of a maximum number of fans.

 Input: The first row of the input file contains the numbers W and H, 2<=W, H ≤ 2000.

 The next H lines of the file contain W characters. Each character is either a '.' (ASCII code 46) –marking a free seat, or '#’ (ASCII code 35) – marking an occupied seat. There is at least one free seat.

Output: Print two integers x and y, separated by a blank, that marks the number of seats and the number of rows.

Rows are marked with 1 to H, in top-bottom order. Seats are enumerated with numbers 1 to W from left to right

Example:

 

Test case 1

Test case 2

Test case 3

Input

2 2

#.

.#

5 5
..#.#
..###
#..##
#.##.
#....


6 4
######
.....#
..##.#
...#.#

Output

2 1

2 4

3 2

 

Äëÿ îòïðàâêè ðåøåíèé íåîáõîäèìî âûïîëíèòü âõîä.

www.contester.ru