atcoder#ABC256G. [ABC256G] Black and White Stones
[ABC256G] Black and White Stones
Score : points
Problem Statement
There is a regular -gon with side length .
Starting from a vertex, we place black or white stones on the circumference at intervals of . As a result, each edge of the -gon will have stones on it, for a total of stones.
How many ways are there to place stones so that all edges have the same number of white stones on them? Find the count modulo .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
3 2
10
There are ways, as follows:
299792458 3141
138897974
Find the count modulo .