## Double Doors Regional P6 - Tudor Learns More DDR

View as PDF

Points: 17
Time limit: 0.6s
Memory limit: 256M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

Tudor is learning how to play Dance Dance Revolution!

Tudor is good at stepping to the beat, but is struggling to deal with more complex note patterns. He decides to focus on -step sequences of notes.

There are four different directions that one can step in Dance Dance Revolution - up, down, left, and right. This means there are different -step sequences of notes.

A spin is defined as four consecutive steps that match a cyclic shift of either LDRU or LURD. This sequence is called a spin because in the event that Tudor alternates feet throughout stepping these notes, he will spin around 360 degrees.

Tudor hates spins because they make him dizzy. Compute the number of -step sequences of notes that do not contain any spins.

#### Input Specification

The first and only line of input will contain a single positive integer which will not exceed .

#### Output Specification

Output, on a single line, the number of -step sequences of notes that do not contain any spins, modulo .

#### Sample Data ZIP

4
248