Problem B
Varied Amusements
Marika and Lisa love going to amusement parks. This time,
they have their eyes set on a park with lots of exciting rides
of three different types: tilt-a-whirls, roller coasters and
drop towers. There are
Input
The first and only line of input contains the integers
Output
Output the number of valid amusement ride sequences. Since
this number can be very large, output it modulo
Scoring
Your solution will be tested on a set of test groups, each worth a number of points. To get the points for a test group you need to solve all test cases in the test group.
Group |
Points |
Constraints |
|
|
|
|
|
No additional constraints |
Sample Input 1 | Sample Output 1 |
---|---|
5 1 2 3 |
1188 |