using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ int M1 = N / (K * K); int rest = N - (K * K) * M1; int M2 = Math.Min(M1, (rest + K - 1) / K); int rest2 = Math.Max(0, rest - M2 * K); int M3 = 0; while(true){ if(M3 * M3 >= rest2) break; M3++; } int M = M2 * (K + 1) + (M1 - M2) * K + M3; char[][] ar = new char[M][]; for(int i=0;iint.Parse(e));} static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));} static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));} }