System Call

Choose one buffer size K for all files to minimize sum over files of ceil(F_i/K) times (T+K).

Hard8MathNumber theoryBrute forceImplementationNo attempts yetTime limit1sMemory limit512 MB

Problem

Operating systems in the Unix family provide a system call named read() for reading files. When passed a buffer of KK bytes, read() loads file contents into that buffer, and one call takes (T+K)(T + K) time, where TT is the fixed per-call overhead. The running time depends only on the buffer size, never on how many bytes are actually read. For example, with a 10-byte buffer, reading 3 bytes and reading 7 bytes both take (T+10)(T + 10) time.

Reading a single file of FF bytes therefore needs F/K\lceil F / K \rceil calls. The total time to read all of NN files with sizes F1,F2,,FNF_1, F_2, \dots, F_N bytes is

i=1NFi/K×(T+K)\sum_{i=1}^{N} \lceil F_i / K \rceil \times (T + K)

Mingyu decided to use one fixed buffer size KK for every file, where KK is a positive integer. Find the buffer size KK that minimizes the total reading time.

Input

The first line contains the number of files NN. The second line contains NN positive integers FiF_i, the file sizes in bytes. The third line contains the fixed per-call time TT, a nonnegative integer.

Output

Print the shortest achievable total reading time and the buffer size KK attaining it, separated by a space. If several buffer sizes achieve the shortest time, print the smallest such KK.

Hint

Linux is a representative Unix-family operating system. macOS also belongs to the Unix family, along with FreeBSD, NetBSD, Solaris, and others.