Dima has a hamsters farm. Soon N hamsters will grow up on it and Dima will sell them in a city nearby.

Hamsters should be transported in boxes. If some box is not completely full, the hamsters in it are bored, that's why each box should be completely full with hamsters.

Dima can buy boxes at a factory. The factory produces boxes of K kinds, boxes of the i-th kind can contain in themselves a_{i} hamsters. Dima can buy any amount of boxes, but he should buy boxes of only one kind to get a wholesale discount.

Of course, Dima would buy boxes in such a way that each box can be completely filled with hamsters and transported to the city. If there is no place for some hamsters, Dima will leave them on the farm.

Find out how many boxes and of which type should Dima buy to transport maximum number of hamsters.


-----Input-----

The first line contains two integers N and K (0 ≤ N ≤ 10^18, 1 ≤ K ≤ 10^5) — the number of hamsters that will grow up on Dima's farm and the number of types of boxes that the factory produces.

The second line contains K integers a_1, a_2, ..., a_{K} (1 ≤ a_{i} ≤ 10^18 for all i) — the capacities of boxes.


-----Output-----

Output two integers: the type of boxes that Dima should buy and the number of boxes of that type Dima should buy. Types of boxes are numbered from 1 to K in the order they are given in input.

If there are many correct answers, output any of them.


-----Examples-----
Input
19 3
5 4 10

Output
2 4

Input
28 3
5 6 30

Output
1 5

Difficulty: interview

Starter code:

Solutions:
n, k = [int(i) for i in input().split(" ")]
A = [int(i) for i in input().split(" ")]

mx=0
mxval=0
for i in range(k):
    if A[i]*(n//A[i])>mxval:
        mxval = A[i]*(n//A[i])
        mx = i
print(mx+1, n//A[mx])


n, k = [int(z) for z in input().split()]
a = [int(z) for z in input().split()]
best = 10000000000000000000
for i in range(k):
    if (n % a[i]) < best:
        best = n % a[i]
        num = n // a[i]
        kor = i + 1
print(kor, num)


n, k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
mn = 10 ** 20
a1, a2 = 1, 0
for i in range(k):
    if n % a[i] < mn:
        mn = n % a[i]
        a1 = i + 1
        a2 = n // a[i]
print(a1, a2)


n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
m = min(enumerate(a), key=lambda l: n % l[1])
print(m[0] + 1, n // m[1])


a, b = map(int,input().split())
k = list(map(int,input().split()))
s = []
for i in range(b):
	s += [[a % k[i], i + 1, a // k[i]]]
s.sort()
print(s[0][1], s[0][2]) 

l = list(map(int,input().split()))
n = l[0]
k = l[1]
a = list(map(int,input().split()))
mx = 0
midx = 0
for i in range(k):
	if a[i]*(n // a[i]) > mx:
		mx = a[i]*(n // a[i])
		midx = i
print(midx+1,n // a[midx])

n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
m = [0]*k
for i in range(k):
    m[i] = n%a[i]
i = m.index(min(m))+1
print(i, n//a[i-1])



import sys, math

#f = open('input/input_1', 'r')
f = sys.stdin

N, K = list(map(int, f.readline().split()))
box_size = list(map(int, f.readline().split()))

ans = -1
ans_cnt = 0
ans_type = 0

for i, b in enumerate(box_size):
  num_box = (N//b)
  if ans < num_box * b:
    ans = num_box * b
    ans_cnt = num_box
    ans_type = i+1

print(ans_type, ans_cnt)


n, k = (int(x) for x in input().split())
a = [int(x) for x in input().split()]
max_i = 0
for i in range(k):
    if (n % a[i]) < (n % a[max_i]):
        max_i = i
print(max_i + 1, n // a[max_i], sep=' ')


def read_nums():
    return [int(x) for x in input().split()]


def get_res(num_hamsters, box_sizes):
    min_index, res_box_size, min_left = 0, box_sizes[0], num_hamsters % box_sizes[0]
    for index, box_size in enumerate(box_sizes):
        cur_left = num_hamsters % box_size
        if cur_left < min_left:
            min_left = cur_left
            min_index = index
            res_box_size = box_size
    return min_index, num_hamsters // res_box_size


def main():
    num_hamsters, num_box_types = read_nums()
    box_sizes = read_nums()
    box_index, num_boxes = get_res(num_hamsters, box_sizes)
    print(box_index + 1, num_boxes)


def __starting_point():
    main()

__starting_point()

import sys

def read_int():
    return int(input())

def read_ints():
    return [int(x) for x in input().split()]

n, k = read_ints()
a = read_ints()

res_i, res_q = 0, 0
for i, b in enumerate(a):
    if n - n % b > a[res_i] * res_q:
        res_i, res_q = i, n // b

print(res_i + 1, res_q)


n, k = [int(i) for i in input().split()]
s = [int(i) for i in input().split()]
u = 100000000000000000000000000000000000000000000
m = 0
for i in range(k):
    if n%(s[i]) < u:
        u = n%(s[i])
        m = i
print(m+1, n//(s[m]))

n, k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
num = -1
mino = int(1e18)
for i in range(k):
    if mino > n % a[i]:
        num = i + 1
        mino = n % a[i]
print(num, n // a[num - 1])

n, k = list(map(int, input().split()))
L = list(map(int, input().split()))
ans = 0
box = 0
for i in range(k):
    new = n // L[i] * L[i]
    if new > ans:
        ans = new
        box = i
print(box + 1, n // L[box])
    


n, k = map(int, input().split())
a = list(map(int, input().split()))
maxi = 0
minimum = n
for i in range(len(a)):
    if n % a[i] < minimum:
        minimum = n % a[i]
        maxi = i

print(maxi + 1, n // a[maxi])

#Python is love <3
n,k = map(int,input().split())
a = list(map(int,input().split()))
fix = -1
maxi = -1
box = -1
for i in range(k):
    to = n//a[i]
    tot = to*a[i]
    #print(to,tot)
    if tot>fix:
        fix = tot
        maxi = to
        box = i+1
print(box,maxi)

R = lambda : map(int, input().split())

n,k = R()
b = list(R())

def solve(n,k,b):
    m = [n % b[i] for i in range(k)]

    from operator import itemgetter
    i = min(enumerate(m), key=itemgetter(1))[0] 

    return i,n//b[i]

t = solve(n,k,b)
print(t[0]+1, t[1])

n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list([n % x for x in a])
c = list([n // x for x in a])

i = b.index(min(b))
print(i + 1, c[i])


def __starting_point():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    m = 10000000000000000000
    j = 0
    c = 0
    for i in range(K):
        k = N%A[i]
        if k < m:
            m = k
            c = N//A[i]
            j = i+1
    print(j, c)
__starting_point()

R=lambda:list(map(int,input().split()))

n, m  = R()

a = list(R())

ans = float('inf')
ans_i = 0

for i in range(m):
    temp = n % a[i]
    if temp < ans:
        ans = temp
        ans_i = i
        
print(ans_i + 1, n//a[ans_i] )


(n, k) = list(map(int, input().split()))

lst = []
for x in input().split():
    lst.append(int(x))

r = n + 1
for x in range(len(lst)):
    if n % lst[x] < r:
        r = n % lst[x]
        t = x

print(t + 1, n // lst[t])


n, k = map(int, input().split())
a = list(map(int, input().split()))
b = []
c = []
for x in a:
	b.append(n//x)
	c.append(n%x)
i = c.index(min(c))
print(i+1, b[i])


n, k =list(map(int,input().split()))

box_type = -1
ans_so_far = 99999999999999999999999
ans = 0
keys = [ int(i) for i in input().split() ]

for i in range(k):
    if n % keys[i] < ans_so_far :
        ans_so_far = n % keys[i]
        box_type = i+1
        ans = n // keys[i]

print(box_type,ans)