Problem 7 of IEMATICS



I thought the answer should be 0, as both numerator and denominator were squared, and for f(x) = 0, the value would be 0.

To those who could solve, what have I misunderstood?


I cannot comment…and I cannot find discuss thread for IEMATICS…So I will write here…
Sorry if it is unrelated…

Can you tell me how you solved Problem 2 …I tried brute force but it didnt help me…
Any help will be appreciated…


@spam_123 - You can generate all the numbers whose sum is 100 by backtracking and then check for the 2*n condition.
The code executed within 5 seconds!


The basic idea was to minimise number of digits first, so for sum to be 100, smallest number would be 19999…

Now, doubling a given digit 1->2 2->4 … 4->8. 5->10 which is equal to 1, 6->3 … 9->9

So keeping in mind these two things, we need doubled number to have sum 10 more. Now doubling increases sum of digits only for digits smaller than 4.

At the end to increase by 10 we can have 244 which gives 488, whose sum is 10 more than the sum of 244. Rest of the digits can be filled by 9
So answer would be 2449999999999


You can solve the question without writing any code. Refer to my comment in the post of @spam_123


0/0 is not 0


Now i look really stupid. Thanks


Welcome :slight_smile: