Suppliers 'A' and 'B' provided the following numbers of products for the luxury hamper market:
Product 'A' 'B'
Although the suppliers try very hard to ship their goods in perfect condition, there is inevitably some spoilage - i.e. products gone bad.
The suppliers compare their performance using two types of statistic:
The per-product spoilage rates for each supplier are equal to the number of products gone bad divided by the number of products supplied, for each of the products in turn.
The overall spoilage rate for each supplier is equal to the total number of products gone bad divided by the total number of products provided by that supplier.
To their surprise, the suppliers found that each of the per-product spoilage rates was worse (higher) for 'B' than for 'A' by the same factor (ratio of spoilage rates),
and yet, paradoxically, the overall spoilage rate was worse for 'A' than for 'B', also by a factor of .
What's the possible value of ? Give your answer as a fraction reduced to its lowest terms, in the form . It's guaranteed that for given tests there is only one possible value of .
First line of each test file contains a single integer which is the number of products. Second line contains integers separated by single spaces. Third line contains integers separated by single spaces.
Print the answer in the form of irreducible fraction
Sample Input 0
310 8 62 9 9
Sample Output 0
Let's assume the following:
For the first product spoilage is for the company 'A' and for the company 'B'.
For the second product spoilage is for the company 'A' and for the company 'B'.
For the third product spoilage is for the company 'A' and for the company 'B'.
It means that the total spoilage is for the company 'A' (rate ) and for the company 'B' (rate )