Cool Subsets
An integer $X$ is *cool* if it has a primitive root modulo $X$. The *coolness* of a non-empty set of $N$ distinct integers $S = \{x_1, x_2, \ldots, x_N\}$ is the number of cool divisors of $\prod_{i=1}^N x_i$. You are given four integers $L$, $R$, $A$ and $B$. Let $S$ be the set containing all integers between $L$ and $R$ (inclusive). Consider all non-empty subsets of $S$ with size between $A$ 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