АВТ
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.

1588. Pair

Time Limit: 1 seconds
Memory Limit:262144KB
Points:100
View Problem Statistics Submit Problem added debug

At the interview senior H&H developers like to give newcomers different tasks. One of the tasks is the following. You are given the K different natural numbers from 1 to N. Your task is to find two of them so that one is divided by another.

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

First line of the input contains numbers N and K (2 ≤ N ≤ 600000, N / 2 + 1 ≤ KN). The second line contains K numbers.

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

Write to the output indexes of the two numbers you found or two zeros if there are no such numbers.

Пример

Входные данные
7 5
4 3 5 7 2
Выходные данные
1 5


View Problem Statistics Submit Problem discussion Author/source:
Problems from Contests and Camps / Trainings in Perm 2009 / 07.07.09 Big Contest /
1587. F - Square 1588. 1589. H - The Fence 1590. I - Painting the Natural Numbers 1591. J - Selection
time generating 0.11 sec.
© Copyright VSU, AVT, Nosov D.A., Andrianov I.A.