India vs Pakistan
All submissions for this problem are available.
The organizers are facing a problem in organizing the much awaited India-Pakistan match. The problem is that if the number of Indian spectators sitting consecutively (one after another) goes beyond k1 and the number of Pakistani spectators sitting consecutively goes beyond k2, they will start fighting. So, organizers are interested in knowing the number of ways n1 Indian spectators and n2 Pakistani spectators can be arranged to maintain peace.
Input contains 4 space separated integers n1, n2, k1 and k2.
Output the number of ways modulo 10^8 , spectators can be arranged such that peace between both the nations is maintained.
Input: 2 1 1 10 2 3 1 2 2 4 1 1 Output: 1 5 0
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP 4.3.2, CPP 6.3, CPP14, JAVA|
Fetching successful submissions
If you are still having problems, see a sample solution here.