ILYN
CodeChefOpen on judge ↗
Consider the following function definitions. f(n) = 2*f(n-1)+f(n-2)+c g(n) = g(n-1)+f(n) And f(0) = f(1) = g(0) = 1. Input First line contains T, the number of test cases and T cases follow. Each test case contains two integers n and c. Output For each test case output one integer the value of g(n) modulo 1000003. Example Input: 5 1 2 2 3 3 4 4 5 5 6 Output: 2 8 28 89 262 Constraints 0 <
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