Battle between Arya and Sansa? Anyone have solution for this problem
It consists of R rounds where in each round a different skill will be put to test. The skill may be Archery, Sword or anything else. After each round, the winner of the round will be awarded a point. After all the R rounds are conducted, the one with maximum points is considered as the overall Winner.Arya is wants not just to win the battle but beat Sansa in such a way that after each round her points are atleast P times the points of Sansa. She wants you to find the number of ways in which she can beat Sansa with the provided condition and take her revenge. The order of winning differentiates the different ways. Example: Let's consider, there are 3 rounds. Case 1: Arya Sansa Arya Case 2:Arya Arya Sansa Both the cases above are different from each other and are considered two different ways. Note: Since the answer can be large, take modulo by 10^9 + 7. #Input Format: The first line of input consists of number of test cases, T The only line of each test case c