Stairs and Functions
CodeChefOpen on judge ↗
Given two ints A and B, find value of function G(A,B) which is defined as Sum(F(x)) where A Input First line consists of t, the number of test cases. Output For each case, output the value of G(A,B) mod 10^9 + 7. Constraints - t = 10000 - 1 A B 1000000000(10^9) Example Input: 10000 1 1 2 3 . . Output: 1 5 . . Explanation G(1,1)=F(1)=1 G(2,3)=F(2)+F(3)=2+3=5 F(3)=Number of ways to
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