Having arrived at the ACM-ICPC contest site in a fun-filled mood, The Team continues their important pre-contest preparations. Specifically, every world-class team knows the importance of making predictions about their upcoming submissions.
The Team knows that they'll get plenty of AC (Accepted) submissions, and
they find those quite boring by now. As such, they'll focus on their
incorrect ones. From their vast experience, The Team knows that they'll
only get exactly
Assuming that their predictions will certainly be correct, the members
of The Team are wondering in how many ways that might occur. In other
words, how many different ordered combinations of
Input Specification
4 integers,
Output Specification
1 integer, the number of valid ordered combinations of submission
results, modulo
Sample Input
3 2 1 0
Sample Output
3
Explanation of Sample
Out of 3 submissions, two are WA, while the third is TLE. The following 3 ordered combinations are then possible:
- WA, WA, TLE;
- WA, TLE, WA; or
- TLE, WA, WA
The answer is then
Comments