Marks :10
: 1 | : 0
Given two arrays $$$numerator[i]$$$ and $$$denominator[i]$$$.
Find the most frequent fraction where fraction = $$$numerator[i]/denominator[i].$$$
If there are multiple such fractions, print the one in which $$$a$$$ is the smallest. If the smallest $$$a$$$ occurs in many then print one with the smallest $$$b$$$.
The first line contains the number $$$n$$$. The second line contains $$$n$$$ integers denoting the numerator array. The third line contains $$$n$$$ integers denoting the denomintor array.$$$(1 \le n \le 10^5)$$$$$$(1 \le numerator[i]\le 10^9)$$$$$$(1 \le denomintor[i]\le 10^9).$$$
If the fraction is $$$a/b$$$ print $$$a$$$ and $$$b$$$ separated by a space i.e $$$a\hspace{1mm} b.$$$
3 1 2 3 4 5 6
1 2
5 1 2 6 7 8 3 4 6 9 10
1 1
4 1 2 3 4 5 12 21 32
1 5
5 25539 29221 6895 82089 18673 2890 99009 89855 30685 39232
1379 17971
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.