fn main() { let mut nk = String::new(); std::io::stdin().read_line(&mut nk).ok(); let nk: Vec = nk.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let n = nk[0]; let k = nk[1]; let cnt = n/k + if n%k > 0 { 1 } else { 0 }; println!("{}", cnt); let mut result = vec![vec!["."; cnt]; cnt]; let mut val = 0usize; for i in 0..cnt { for j in i..i+k { result[i][j%cnt] = "#"; val += 1; if val == n { break; } } if val == n { break; } } for i in 0..cnt { println!("{}", result[i].join("")); } }