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++,
C++14,
Clojure,
C#,
D,
Erlang,
F#,
Go,
Groovy,
Haskell,
Java,
Java 8,
JavaScript(Rhino),
JavaScript(Node.js),
Julia,
Kotlin,
Lisp,
Lisp (SBCL),
Lua,
Objective-C,
OCaml,
Octave,
Pascal,
Perl,
PHP,
Python,
Python 3,
R(RScript),
Racket,
Ruby,
Rust,
Scala,
Swift,
Swift-4.1,
Visual Basic

Initializing Code Editor...

{"10963e7": "/pagelets/problem-author-tester/algorithm/open-the-locks/", "aa346ba": "/pagelets/recommended-problems/algorithm/open-the-locks/", "a36971b": "/pagelets/suggested-problems/algorithm/open-the-locks/", "e2be5e5": "/pagelets/problems-hint/algorithm/open-the-locks/", "f38d385": "/pagelets/show-submission/algorithm/open-the-locks/"}

realtime.hackerearth.com

80

37b9b867ff2fddb1f088db2e7291c503a8cad075

58a29e5cae2309f04b28

/realtime/pusher/auth/