pastebin

Paste Search Dynamic
Recent pastes
fx
  1. f = [0] * 1000000
  2. f[2] = 1
  3. f[3] = 1
  4. f[4] = 2
  5. n = int(input())
  6. for x in range(5, 1000000):
  7.         if x > n: break;
  8.         f[x] = (f[x-2] + f[x-3] + f[x-4]) % 10000000007;
  9. print(f[n])
Parsed in 0.002 seconds