N = int(input())
A = list(map(int, input().split()))
A_max = max(A)

is_start_increase = [0]*N
is_end_increase = [0]*N
is_increasing = [0]*N

for i in range(1, N):
    if A[i-1] <= A[i]:
        is_increasing[i] = 1
        if i==1:
            is_increasing[i] = 1

for i in range(N-1):
    if i == 0 and is_increasing[i+1] == 1:
        is_start_increase[i] = 1
    if i == 1 and is_start_increase[i-1]==1:
        continue
    elif is_increasing[i] == 1 and is_increasing[i-1] == 0:
        is_start_increase[i] = 1
    elif is_increasing[i] == 1 and is_increasing[i+1] == 0:
        is_end_increase[i] = 1


money = 1000
stock = 0
for i in range(N):
    if i==N-1:
        # print("last", i)
        money += stock * A[i]
        break
    if is_start_increase[i]:
        # print("start", i)
        stock += money // A[i]
        money -= A[i] * stock
    if is_end_increase[i]:
        # print("end", i)
        money += stock * A[i]
        stock = 0

print(money, stock)
# dp = [[0, 0, 0, 0] for i in range(N+1)]
# dp[0][0] = 1000 # 何もしない
# dp[0][1] = 1000 # 買う
# dp[0][2] = 1000 # 売り
# dp[0][3] = 0 #株

# for i in range(1,N+1):
#     dp[i][2] = max(dp[i-1][0])
#     dp[i][0] = dp[i-1][0]
#     dp[i][3] = dp[i][3]
#     if (dp[i-1][0]//A[i]) >= (dp[i-1][2]//A[i]):
#         dp[i][3] = dp[i-1][0]//A[i]
#         dp[i][1] = dp[i-1][0] - A[i]*dp[i][3]
        
#     else:
#         dp[i][3] = dp[i-1][2]//A[i]
#         dp[i][1] = dp[i-1][2] - A[i]*dp[i][3]
        
    
#     # dp[i][1] = max(dp[i-1][0] - A[i] * (dp[i-1][0]//A[i]), dp[i-1][2] - A[i] * (dp[i-1][2]//A[i]))


# money = 1000
# stock = 0
# for i in range(N):
#     if i==N-1:
#         money += stock * A[i]
#         break
#     if A[i] < A[i+1]:
#         stock = money//A[i]
#         money -= A[i] * stock
#     elif A[i] > A[i+1]:
#         money += stock * A[i]
#         stock = 0
# print(money)

