← All problemsSign in

SuperFunction

CodeChefRating 2762Open on judge ↗

Mike likes to invent new functions. The latest one he has invented is called SuperFunction. Let's consider how it can be calculated: You are given two integers N and K. SuperFunction of N and K equals to the sum of K'th powers of the positive numbers, which are coprime with N and also not greater than N. I.e. SuperFuntion of 6 and 3 equals to 13 + 53 = 126. Mike knows how to calculate SuperFunc

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