Un triangle P95709


Statement
 

Graphic problem

pdf   zip

html

Feu un programa que dibuixi un tauler rectangular amb un triangle.

Entrada

L’entrada consisteix en dos noms de color f i c, i de tres naturals b, a i x. Podeu assumir b ≥ 1, a ≥ 1 i 0 ≤ x < b.

Sortida

Cal generar una imatge (b, a) de color de fons f. Pinteu-hi un triangle de color c de base b, alçada a, i que tingui el pic del marge superior de la imatge al punt horitzontal x.

Public test cases
  • Input

    Beige
    Red
    500
    300
    400
    

    Output

    sample-1.png

     (500×300)

  • Input

    Plum
    GreenYellow
    18
    8
    5
    

    Output

    sample-2.png

     (18×8)

  • Information
    Author
    Salvador Roura
    Language
    Catalan
    Official solutions
    Python
    User solutions
    Python