largura = int(input("Digite a largura: "))
print("")
altura = int(input("Digite a altura: "))
print("")
caractere = "#"
def retângulo(largura, altura, caractere):
linha_cheia = caractere * largura
if largura > 2:
linha_vazia = caractere + (" " * (largura - 2)) + caractere
else:
linha_vazia = linha_cheia
if altura >= 1:
print(linha_cheia)
for i in range(altura - 2):
print(linha_vazia)
if altura >= 2:
print(linha_cheia)
retângulo(largura, altura, caractere)
bGFyZ3VyYSA9IGludChpbnB1dCgiRGlnaXRlIGEgbGFyZ3VyYTogIikpCnByaW50KCIiKQphbHR1cmEgPSBpbnQoaW5wdXQoIkRpZ2l0ZSBhIGFsdHVyYTogIikpCnByaW50KCIiKQpjYXJhY3RlcmUgPSAiIyIKCmRlZiByZXTDom5ndWxvKGxhcmd1cmEsIGFsdHVyYSwgY2FyYWN0ZXJlKToKCiAgICBsaW5oYV9jaGVpYSA9IGNhcmFjdGVyZSAqIGxhcmd1cmEKICAgIGlmIGxhcmd1cmEgPiAyOgogICAgICAgIGxpbmhhX3ZhemlhID0gY2FyYWN0ZXJlICsgKCIgIiAqIChsYXJndXJhIC0gMikpICsgY2FyYWN0ZXJlCiAgICBlbHNlOgogICAgICAgIGxpbmhhX3ZhemlhID0gbGluaGFfY2hlaWEKCiAgICBpZiBhbHR1cmEgPj0gMToKICAgIAlwcmludChsaW5oYV9jaGVpYSkKICAgIGZvciBpIGluIHJhbmdlKGFsdHVyYSAtIDIpOgogICAgICAgIHByaW50KGxpbmhhX3ZhemlhKQogICAgaWYgYWx0dXJhID49IDI6CiAgICAgICAgcHJpbnQobGluaGFfY2hlaWEpCgpyZXTDom5ndWxvKGxhcmd1cmEsIGFsdHVyYSwgY2FyYWN0ZXJlKQ==