#abc118d. [abc118_d]Match Matching

[abc118_d]Match Matching

nn根火柴,mm种数字,数字1,2,3,4,5,6,7,8,9分别需要2,5,5,4,5,6,3,7,6根火柴,要求nn根火柴全部都用完且拼成的数字最大,输出这个数字。