#include #include #include #include #include #include #include #include #include #include #include #include #define vll vector #define vvvl vector #define vvl vector> #define VV(a, b, c, d) vector>(a, vector(b, c)) #define VVV(a, b, c, d) vector(a, vvl(b, vll (c, d))); #define re(c, b) for(ll c=0;c> n >> k; // ### // ### // ### ll m = (n/(k*k)) * k; ll ad = (n%(k*k)); ll x = 0; for(int i=0;i<=k;i++){ if(i*i>=ad){ x = i; break; } } if((k+1)*k>=n&&m+x>=k+1){ ll ad = n; std::cout << k+1 << '\n'; for(int i=0;i<=k;i++){ for(int j=0;j<=k;j++){ if(i==j) std::cout << "."; else if(ad){ std::cout << "#"; ad--; }else std::cout << "."; } std::cout << '\n'; } return 0; } std::cout << m + x << '\n'; vvl d = VV(m+x, m+x, 0, ll); for(int i=0;i