Many in line P25174


Statement
 

pdf   zip

Write a program that reads cubes n×n×nn \times n \times n of integer numbers and computes how many lines of size mm contains, for any mm between 2 and nn. Here, a line is a sequence of identical integer numbers adjacents in the same direction. The considered directions are vertical, horizontal, of depth, (in total, 26 senses, in 13 directions).

Input

Input consists of a sequence of cube descriptions separated by an empty line. Each description starts with a natural n2n \ge 2. nn descriptions of each plane of the cube follow, separated by an empty line, each plane has nn rows with nn integer numbers each one.

Output

for each cube, print how many lines of size mm contains, for any mm between 2 and nn. Follow the format of the examples. Separate the different outputs with an empty line.

Public test cases
  • Input

    2
    1 1
    1 1
    
    4 4
    4 4
    
    2
    1 2
    3 1
    
    1 6
    7 8
    
    3
    1 1 1
    1 1 1
    1 1 1
    
    1 1 1
    1 1 1
    1 1 1
    
    1 1 1
    1 1 1
    1 1 1
    

    Output

    Ratlles de mida 2: 12
    
    Ratlles de mida 2: 3
    
    Ratlles de mida 2: 158
    Ratlles de mida 3: 49
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++
    User solutions
    C++