playing a game on a round board with n (2≤n≤106) cells. The cells are numbered from 1 to n so that for every I (1≤i≤n−1) cell I is contiguous cell i+1 and cell 1 is nearby cell n. At first, every cell is unfilled.    Omkar and Akmar alternate setting either An or a B on

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Correct answer will upvoted else downvoted.

 

playing a game on a round board with n (2≤n≤106) cells. The cells are numbered from 1 to n so that for every I (1≤i≤n−1) cell I is contiguous cell i+1 and cell 1 is nearby cell n. At first, every cell is unfilled. 

 

Omkar and Akmar alternate setting either An or a B on the board, with Akmar going first. The letter should be set on a vacant cell. What's more, the letter can't be put nearby a cell containing a similar letter. 

 

A player loses when it is their move and there are not any more substantial moves. 

 

Output the number of conceivable particular games where the two players play ideally modulo 109+7. Note that we just consider games where some player has lost and there are not any more substantial moves. Two games are considered unmistakable if the number of turns is unique or for some turn, the letter or cell number that the letter is put on were unique. A move is considered ideal if the move amplifies the player's shot at winning, accepting the other player plays ideally also. All the more officially, if the player who needs to move has a triumphant system, they need to take action after which they will in any case have a triumphant technique. In the event that they don't, they can take any action. 

Input :The main line will contain an integer n (2≤n≤106) — the number of cells on the board. 

Output :Output a solitary integer — the number of conceivable unmistakable games where the two players play ideally modulo 109+7.

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education