Many in line P25174


Statement
 

pdf   zip

html

Write a program that reads cubes n × n × n of integer numbers and computes how many lines of size m contains, for any m between 2 and n. 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 n ≥ 2. n descriptions of each plane of the cube follow, separated by an empty line, each plane has n rows with n integer numbers each one.

Output

for each cube, print how many lines of size m contains, for any m between 2 and n. 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++