Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register
Language:
Jackpot
Time Limit: 20000MSMemory Limit: 64000K
Total Submissions: 1196Accepted: 257
Case Time Limit: 2000MS

Description

The Great Dodgers company has recently developed a brand-new playing machine.
You put a coin into the machine and pull the handle. After that it chooses some integer number. If the chosen number is zero you win a jackpot. In the other case the machine tries to divide the chosen number by the lucky numbers p1 , p2 , . . . , pn . If at least one of the remainders is zero --- you win.
Great Dodgers want to calculate the probability of winning on their machine. They tried to do it, but failed. So Great Dodgers hired you to write a program that calculates the corresponding probability.
Unfortunately, probability theory does not allow you to assume that all integer numbers have equal probability. But one mathematician hinted you that the required probability can be approximated as the following limit:
limk→∞(Sk/2k+1).

Here Sk is the number of integers between -k and k that are divisible by at least one of the lucky numbers.

Input

Input file contains n --- the number of lucky numbers (1 <= n <= 16), followed by n lucky numbers (1 <= pi <= 109 ).

Output

It is clear that the requested probability is rational. Output it as an irreducible fraction.
On the first line of the output file print the numerator of the winning probability. On the second line print its denominator. Both numerator and denominator must be printed without leading zeroes. Remember that the fraction must be irreducible.

Sample Input

2
4 6

Sample Output

1
3

Source

Northeastern Europe 2004, Northern Subregion

[Submit]   [Go Back]   [Status]   [Discuss]

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator