Submit | All submissions | Best solutions | Back to list |
HS11BULH - Building allowance |
Last week a new street in Bitland was constructed. You, as the city's building manager, are now responsible for a very important task. You have to decide on which plots along the street it is allowed to build new buildings. In order to this, you want to calculate first the number of possible ways of assigning free plots to buildings with the restriction that no 2 consecutive plots exist on which it is allowed to build - you want to give the inhabitants the feeling that they have more free room. The street is divided into N sections. Each section corresponds to 2 plots, one on each side of the street. Find the number of possible assignments subject to the given restriction modulo 1,000,000,007.
Input
In the first line you're given N ( N ≤ 231 - 1 ).
Output
In the first and only line output the result modulo 1,000,000,007.
Example
Input: 3 Output: 25
Example explanation:
If we just look at the one street side and mark B as a plot where building is allowed and F as a free plot, we have: BFB, FBF, FFB, BFF, FFF.
Since the same number exists on the other side, we have 5*5 = 25 combinations.
Scoring
By solving this problem you score 10 points.
Added by: | Damir Ferizovic |
Date: | 2011-10-14 |
Time limit: | 0.306s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | ADA95 ASM32 ASM64 BASH BF C CSHARP C++ 4.3.2 CPP C99 CLPS CLOJURE LISP sbcl LISP clisp D ERL FSHARP FORTRAN GO HASK ICON JAVA JS-RHINO LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PERL6 PHP PIKE PRLG-swi PYTHON PYTHON3 RUBY SCALA SCM guile SCM qobi ST TCL WHITESPACE |
Resource: | High School Programming League 2011/12 |