Problem3010--打拳

3010: 打拳

Time Limit: 5.000 Sec  Memory Limit: 256 MB
Submit: 13  Solved: 3
[Submit] [Status] [Web Board] [Creator:]

Description




Input




Output


Sample Input

2 2 2 998244353 
3 4 

Sample Output

8

HINT


Source/Category

 

[Submit] [Status]