← All problemsSign in

Karthikeya Numbers

CodeChefRating 3147Open on judge ↗

A number $N$ is said to be $X$-valid if $N$ is even, and all numbers from $\{1, 2, ..., N\}$ can be split into $\frac{N}{2}$ mutually exclusive pairs of $2$, where each pair has a sum which is a power of $X$. Given $N$ and $X$, find the number of integers $i$ satisfying $1 \le i \le N$ and $i$ is $X$-valid. ### Input - The first line of input will contain a single integer $T$, denoting the numb

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