SOLVE

LATER

Open the locks

Problem

Editorial

Analytics

Every lock sequence in hogwarts is a sequence of length **N** and contains digits from **0 - 9** . Now there is a constraint that each lock sequence will not contain two adjacent numbers such that they sum up to a prime number.

For example 9994 is an invalid sequence of lock because 9+4 = 13 but 13 is a prime number. 9993 is a valid sequence of lock beacuse there are no two adjacent numbers such that theys sum up to a prime number.

So for the given length **N** you have to count total possible lock sequences modulo **10^9+7**

**Input**

First line contains a number **N** as input

**Output**

Output total locks possible as per the given constraints

**Constraints**

1≤ **N** ≤ 10^{5}

Explanation

There are 63 locks possible . 00 is also a valid lock sequence.

Time Limit:
1.0 sec(s)
for each input file.

Memory Limit:
256 MB

Source Limit:
1024 KB

Marking Scheme:
Marks are awarded when all the testcases pass.

Allowed Languages:
C,
C++,
Clojure,
C#,
D,
Erlang,
F#,
Go,
Groovy,
Haskell,
Java,
Java 8,
JavaScript(Rhino),
JavaScript(Node.js),
Lisp,
Lisp (SBCL),
Lua,
Objective-C,
OCaml,
Octave,
Pascal,
Perl,
PHP,
Python,
Python 3,
R(RScript),
Racket,
Ruby,
Rust,
Scala,
Scala 2.11.8,
Swift,
Visual Basic

Initializing Code Editor...

{"8c68aa4": "/pagelets/problems-hint/algorithm/open-the-locks/", "8c68a8b": "/pagelets/problem-author-tester/algorithm/open-the-locks/", "8c68a30": "/pagelets/suggested-problems/algorithm/open-the-locks/", "8c66d69": "/pagelets/show-submission/algorithm/open-the-locks/", "8c68abb": "/pagelets/recommended-problems/algorithm/open-the-locks/"}

{}

realtime.hackerearth.com

80

37b9b867ff2fddb1f088db2e7291c503a8cad075

58a29e5cae2309f04b28

/realtime/pusher/auth/