Coder

题意翻译

## 题目描述 Iahub 很喜欢下棋。他甚至发明了一种棋子叫做 "Coder"。 一个 Coder 可以攻击与它相邻的格子中的棋子(水平和竖直方向)。如果一个 Coder 在坐标 $(x,y)$上,它可以攻击 $(x+1,y)$ , $(x-1,y)$ , $(x,y+1)$ , $(x,y-1)$ 这四个格子。 Iahub 想要知道有多少个 Coder 可以被放在 $n*n$ 的棋盘中,使得任意两个 Coder 都不能互相攻击。 ## 输入输出格式 ### 输入格式 一行一个数 $n$ ,表示棋盘的大小。 ### 输出格式 第一行一个数,表示最多可以放几个 Coder。 接下来一个 $n*n$ 的字符矩阵,每个位置是 `c` 或 `.` ,分别表示这个位置放与不放棋子。 如果有多个解,随意输出一个解即可。

题目描述

Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position $ (x,y) $ , he can move to (or attack) positions $ (x+1,y) $ , $ (x–1,y) $ , $ (x,y+1) $ and $ (x,y–1) $ . Iahub wants to know how many Coders can be placed on an $ n×n $ chessboard, so that no Coder attacks any other Coder.

输入输出格式

输入格式


The first line contains an integer $ n $ $ (1<=n<=1000) $ .

输出格式


On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next $ n $ lines print $ n $ characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.

输入输出样例

输入样例 #1

2

输出样例 #1

2
C.
.C