5 Modular Arithematic
CodeChefOpen on judge ↗
You will be given an integer $N$, print out $(N^3 + N^2 + N^1 ) \% P $ Here $\%$ represents modulo operation. And $P = 10^9 + 7$. ###Input: - First line of input will contain a number $T$, the number of elements in the array - The first line of each testcase will contain $N$ . ###Output: - For each test case , print out $(N^3 + N^2 + N^1 ) \% P $ , where $P = 10^9 + 7$. ###C
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