Pool table (2) P26585


Statement
 

pdf   zip

thehtml

This exercise has the same statement that ‍; the only difference is that now you can use vectors to solve it.

Write a program that reads the dimensions of a pool table, and that prints with zeros the trajectory of a ball after hitting it in the upper left corner with an angle of 45 degrees.

Input

Input consists of several cases, each with the number of rows and the number of columns. Both numbers are, at least, 2. None of the numbers is “too big”.

Output

Print every pool table as shown in the examples, and an empty line after each table.

Public test cases
  • Input

    7 4
    10 16
    

    Output

    ######
    #0   #
    # 0  #
    #  0 #
    #   0#
    #  0 #
    # 0  #
    #0   #
    ######
    
    ##################
    #0     0     0   #
    # 0   0 0   0 0  #
    #  0 0   0 0   0 #
    #   0     0     0#
    #  0 0   0 0   0 #
    # 0   0 0   0 0  #
    #0     0     0   #
    # 0   0 0   0 0  #
    #  0 0   0 0   0 #
    #   0     0     0#
    ##################
    
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++ Java Python
    User solutions
    C++ Python