Ribbon

No attempts yetTime limit2sMemory limit256 MB

Problem

Jim wants to make a lot of bows for her birthday party, so she buys several rolls of ribbon in different colors. When she starts making the bows she finds that the first inch and the last inch of every roll are dirty and cannot be used. To make bows she has to cut the ribbon, and the pieces have to be as long as possible. Every piece must have the same length.

A roll of length kk gives k2k - 2 inches of usable ribbon once the dirty inch at each end is dropped. Every roll must be cut into pieces of that one common length with nothing left over.

Input

The input is read from standard input and consists of several lines. Each line starts with the integer nn, the number of rolls, where 2n102 \le n \le 10. Then come nn numbers, the ribbon length kk of each roll, where 5k5000005 \le k \le 500000. All numbers on a line are separated by a single space. Process the lines until the input ends.

Output

For each input line print two integers on one line, separated by a single space. The first number is the length of one cut piece. The second number is the total number of bows Jim can make.