АВТ
Language: Russian
English

Remote Training on Programming

Problems Online status Contests
News FAQ E-learning
For authors:
Register  ||  Login
 
Hello, Guest! Please login or register.

1589. The Fence

Time Limit: 0.5 seconds
Memory Limit:262144KB
Points:100
View Problem Statistics Submit Problem added 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


View Problem Statistics Submit Problem discussion Author/source:
Problems from Contests and Camps / Trainings in Perm 2009 / 07.07.09 Big Contest /
1588. G - Pair 1589. 1590. I - Painting the Natural Numbers 1591. J - Selection 1592. K - Parquet
time generating 0.109 sec.
© Copyright VSU, AVT, Nosov D.A., Andrianov I.A.