#P7945. Maximizing Points in Cirno's Graph Game
Maximizing Points in Cirno's Graph Game
Maximizing Points in Cirno's Graph Game
Cirno drew a graph consisting of \(4\cdot n\) nodes numbered from \(0\) to \(4n-1\). The graph has two types of complete subgraphs (cliques):
- For any \(0\le i\le 3\) and \(0\le j,k<n\), the nodes \(n\cdot i+j\) and \(n\cdot i+k\) are mutually connected (row cliques).
- For any \(0\le i<n\) and \(0\le j,k\le 3\), the nodes \(i+n\cdot j\) and \(i+n\cdot k\) are mutually connected (column cliques).
In the game, Cirno first colors exactly \(2n\) nodes blue (her choice) and leaves the other \(2n\) nodes red. Then there are \(2n\) turns. In each turn, Cirno picks a blue node and afterward Daiyousei picks a red node. If the chosen blue and red nodes are connected (i.e. they belong to the same row clique or the same column clique), Daiyousei earns one point.
Your task is to compute the maximum possible number of points that Daiyousei can achieve when he plays optimally. It turns out that no matter how Cirno colors the nodes or orders her blue moves, Daiyousei can always guarantee to score a point in every turn.
Thus, the answer is simply \(2n\).
inputFormat
The input consists of a single integer \(n\) representing the parameter of the graph.
outputFormat
Output a single integer, the maximum number of points Daiyousei can achieve.
sample
1
2