Processing math: 0%

Problem C. Calculate a limit

Author:A. Klenin   Time limit:1 sec
Input file:input.txt   Memory limit:64 Mb
Output file:output.txt  

Statement

Your program must calculate the value of lim.

All coefficients are integers, so the answer must be calculated exactly and presented in the form of irreducible fraction.

Input file format

Input file contains integer n followed first by n integers a_1\,a_2 \ldots a_n and then by n integers b_1\,b_2 \ldots b_n.

Output file format

Output file must contain two integers — nominator and denominator of the fraction. If the limit is zero, output integers 0 1. If the limit is infinity, output integers 1 0.

Constraints

1 \le n \le 100, 0 \le a_i,\,b_i \le 10^9, \sum\limits_i (b_i + a_i) \gt 0

Sample tests

No. Input file (input.txt) Output file (output.txt)
1
1
2 4
1 2
2
2
0 1  1 0
1 0

0.058s 0.007s 13