Un triangle P95709


Statement
 

Graphic problem

pdf   zip

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

Entrada

L’entrada consisteix en dos noms de color ff i cc, i de tres naturals bb, aa i xx. Podeu assumir b1b \ge 1, a1a \ge 1 i 0x<b0 \le x < b.

Sortida

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

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