0

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

10th Oct 2019, 5:00 AM
NIKITA PATEL
NIKITA PATEL - avatar
4 Answers
+ 2
Because for input :1000 rounds or more The possibilities of winning gives large answer
10th Oct 2019, 6:54 AM
NIKITA PATEL
NIKITA PATEL - avatar
+ 1
What is the purpose of taking modulo 10^9+7 ?
10th Oct 2019, 6:45 AM
Sonic
Sonic - avatar
+ 1
Input: 2 4 2 2 2 First line is for number of test cases In Second line 4 shows number of Output 3 1
10th Oct 2019, 6:57 AM
NIKITA PATEL
NIKITA PATEL - avatar
0
I am very sure that there was a long thread on that very problem in Q&A but it seems to have been deleted. You can access (part of) it by Google search "Arya and Sansa site:sololearn.com" if you don't hit the link but choose the cache instead.
10th Oct 2019, 8:10 AM
Thoq!
Thoq! - avatar