Fast counting
CodeChefOpen on judge ↗
$f( X ) $ means sum of the digits of the number X. For example, $f( 12345 ) = 1+2+3+4+5 = 15$ . Now consider the following equation: $x = a \ast f( x )^b + c \ast f( x )^d$ You have to find the number of $x$ , where $x \leq 10^{18} $ ###Input: - First line will contain $T$, number of testcases. Then the testcases follow. - Each testcase contains of a single line of input, four integers $a$, $
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.
Sign in to chat with the tutor and save your progress.
Sign in to start