← All problemsSign in

Special Integers

An Integer $x$ is called special in this case when, for every positive integer $y$ such that $y \gt x$, $\frac{x}{f(x)} \leq \frac{y}{f(y)}$ holds. Where, $f(d)$ denotes the sum of the digits in the decimal representation on $d$. Given a range $[A, B]$ find $(B - A + 1)$ special numbers, specifically meaning find them starting from the $A$th smallest special number to $B$ th smallest special num

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start