fork download
  1. for _ in range(5):
  2. x,y,A,a,b,n=input()
  3. exec'A+=a*A[-x]+b*A[-y],;'*n
  4. print A[n]
Success #stdin #stdout 0.02s 9024KB
stdin
1, 2, [1,1], 1, 1, 6
1, 2, [2, 1], 1, 1, 8
3, 5, [2, 3, 5, 7, 11], 2, 3, 8
1, 3, [-5, 2, 3], 1, 2, 10
5, 7, [-5, 2, 3, -7, -8, 1, -9], -10, -7, 10
stdout
13
47
53
-67
39