ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Winner's Camp > задача:


10. 50475 - Voice advertising

Гость
• Обсуждение задачи (1)

Задачи сборника

• 06. 50714 - The knight
• 12. 50723 - Tribonacci
• 04. 50649 - Puzzle
• 01. 50722 - Problemi i shkencetarit
• 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

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
National Olympiads in Montenegro. Сложность Бета

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