typedef long long ll; #include using namespace std; int main() { ll n,k; std::cin >> n>>k; ll r = (n+k-1)/k; std::cout << r << std::endl; vector> ans(r,vector(r,0)); ll offset = 0; for (int i = 0; i < r; i++) { for (int j = 0; j < min(k,r); j++) { if(n>0){ ans[i][(j+offset)%r]=1; n--; } } offset++; } for (int i = 0; i < r; i++) { for (int j = 0; j < r; j++) { std::cout << (ans[i][j]==1 ? "#":"."); } std::cout << std::endl; } }