/******************************************************* * Copyright (C) 2015 Haotian Wu * * This file is the solution to the question: * https://www.hackerrank.com/challenges/encryption * * Redistribution and use in source and binary forms are permitted. *******************************************************/ #include #include #include #include #include #include #include #include #include using namespace std; // Compute sqrt(L). Watch out float point error. int main() { char str[100]; scanf("%s",str); int l = strlen(str); int floorl = (int)(sqrt(l)+1e-9); int ceill = (l==floorl*floorl? floorl : floorl+1); char grid[10][10] = {0}; int x=0,y=0; for (int i=0;i