Simple Recursive Sequence The K-Fantastic Sequence Is Defined In The Following Way: (Ai+1=(K∗Bi+Ai∗Ai))Mod3001(Bi+1=(K∗Ai+I))Mod3001 Where A0=1 And B0=2
Simple recursive sequence The K-fantastic sequence is defined in the following way:
(ai+1=(k∗bi+ai∗ai))mod3001(bi+1=(k∗ai+i))mod3001 where a0=1 and b0=2 What is the Tth pair of numbers of the K-fantastic sequence? Function description Complete the solve() function. This function takes the following 2 parameters and returns the answer: - K : Represents an Integer denoting the value of K - T : Represents an Integer denoting the value of T Input format for custom testing Note: Use this input format if you are testing against custom input or writing code in a language where we don't provide bollerplate code - The first line contains two space-separated integers denoting the value of K and T. Output format Print aT and bT. Constraints (0≤K≤30000≤T≤109) Sample input E Sample output 5 10 2601513 Explanation 0:12 1: 117 2: 15662 3: 638842 4: 1171031 5: 8381616 6: 20882805 7: 13121241 8: 19741799 9: 13702666 10: 2601513 vector



write a program(preferably in c++) for the same
needed urgently
don't copy from chatgpt or I'll downvote
run all the test cases
Comments
Post a Comment