Company: Tridence_8aug
Difficulty: medium
Enigma function Problem Description Enigma is a function that takes three inputs X , i and j and produces a single output. It is defined as: Enigma[i][j] = X if i == 0 or j == 0 Enigma[i][j] = ( sum over p = 0 .. i of Enigma[p][j-1] ) % mod otherwise The value of mod is the same for every test case: mod = 1000000007 . Complete the function solve(X, i, j) , which returns K = Enigma[i][j] % mod for the given X , i and j . Input Format Read from standard input. T X i j X i j ... Line 1 contains the integer T , the number of test cases. Each of the next T lines contains three integers X , i and j , separated by single spaces. Output Format For each test case, print K = Enigma[i][j] % 1000000007 on its own line, in the order the test cases are given. Constraints 1 <= T <= 1000 (inferred -- the source states T <= 10^5 ; 10^5 answers of up to 10 digits each would exceed this judge's 18000-byte output limit, so the bound is lowered.) 0 <= X <= 10^5 0 <= i <= 10^5 0 <= j