# your code goes here
import math
def bouquets(narcissus_price, tulip_price, rose_price, summ):
prices = sorted( [ narcissus_price, tulip_price, rose_price ], reverse = True )
counter = 0
for i in range( math.floor( summ / prices[0] ) + 1 ):
for j in range( math.floor( ( summ - i * prices[0] ) / prices[1] ) + 1):
last_count = math.floor( ( summ - i * prices[0] - j * prices[1] ) / prices[2] ) + 1
if ( i + j ) % 2 == 0 :
counter += math.floor( last_count / 2 )
else :
counter += math.ceil( last_count / 2 )
return counter
print( bouquets(200,300,400,100000) )
IyB5b3VyIGNvZGUgZ29lcyBoZXJlCmltcG9ydCBtYXRoCgpkZWYgYm91cXVldHMobmFyY2lzc3VzX3ByaWNlLCB0dWxpcF9wcmljZSwgcm9zZV9wcmljZSwgc3VtbSk6CiAgICBwcmljZXMgPSBzb3J0ZWQoIFsgbmFyY2lzc3VzX3ByaWNlLCB0dWxpcF9wcmljZSwgcm9zZV9wcmljZSBdLCByZXZlcnNlID0gVHJ1ZSApCiAgICBjb3VudGVyID0gMAogICAgZm9yIGkgaW4gcmFuZ2UoIG1hdGguZmxvb3IoIHN1bW0gLyBwcmljZXNbMF0gKSArIDEgKToKICAgICAgICBmb3IgaiBpbiByYW5nZSggbWF0aC5mbG9vciggKCBzdW1tIC0gaSAqIHByaWNlc1swXSApIC8gcHJpY2VzWzFdICkgKyAxKToKICAgICAgICAgICAgbGFzdF9jb3VudCA9IG1hdGguZmxvb3IoICggc3VtbSAtIGkgKiBwcmljZXNbMF0gLSBqICogcHJpY2VzWzFdICkgLyBwcmljZXNbMl0gKSArIDEKICAgICAgICAgICAgaWYgKCBpICsgaiApICUgMiA9PSAwIDoKICAgICAgICAgICAgCWNvdW50ZXIgKz0gbWF0aC5mbG9vciggbGFzdF9jb3VudCAvIDIgKQogICAgICAgICAgICBlbHNlIDoKICAgICAgICAgICAgCWNvdW50ZXIgKz0gbWF0aC5jZWlsKCAgbGFzdF9jb3VudCAvIDIgKQogICAgICAgICAgIAogICAgcmV0dXJuIGNvdW50ZXIKICAgIApwcmludCggYm91cXVldHMoMjAwLDMwMCw0MDAsMTAwMDAwKSApCg==