Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python Code The fraction 4 9 / 9 8 is a curious fraction. An inexperienced mathematician while attempting to simplify it may incorrectly believe that
Python Code
The fraction is a curious fraction. An inexperienced mathematician while attempting to simplify it may incorrectly believe that is obtained by cancelling the s
We shall consider fractions like, to be trivial examples.
Which means fractions where trailing s are cancelled are trivial. So we will ignore all the cases where we have to cancel s
You will be given integers N and K N represents the number of digits in Numerator and Denominator, and K represents the exact number of digits to be "cancelled" from Numerator and Denominator. Find every nontrivial fraction, where numerator is less than denominator, and the value of the reduced fraction is equal to the original fraction.
Sum all the Numerators and the Denominators of the original fractions, and print them separated by a space.
Input Format
Input contains two integers N K
Constraints
N
KN
Output Format
Display space separated integers that denote the sum of the Numerators and the sum of the Denominators respectively of original fractions.
Note You do not have to reduce the Numerator and Denominator.
Sample Input
Sample Output
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started