АВТ
Язык:

Дистанционный практикум по программированию

Задачи Online статус Соревнования
Новости Справка СДО
 
Здравствуйте, Гость! Войдите с паролем или зарегистрируйтесь.

1589. The Fence

Ограничение времени: 0.5 сек.
Ограничение памяти:262144 КБайт
Баллы:100
Статистика Послать на проверку Задачу добавил debug

There is a long fence not far from H&H office. A while ago boards of the fence were painted in different colors. Now H&H CTO wants to know, if there are two red boards in the fence with the number of boards between them multiple to K.

Входные данные

The first line contains the integer number K (1 ≤ K ≤ 100000). The second line contains the description of the fence. Symbol —"1" indicates the red board, and symbol "0" — any other. The fence contains not more than 100000 boards.

Выходные данные

Output the numbers of required boards, or output two zeros if they do not exist. Boards are numbered starting with 1 from left to right.

Пример

Входные данные
3
00101000010
Выходные данные
3 10


Статистика Послать на проверку Обсуждение задачи Автор/источник:
Задачи с соревнований и сборов / Сборы в Перми 2009 / 07.07.09 Большой контест /
1588. G - Pair 1589. 1590. I - Painting the Natural Numbers 1591. J - Selection 1592. K - Parquet
 
время генерации 0.5 сек.
© Copyright ВоГУ, АВТ, Носов Д.А., Андрианов И.А.