On puzzling SE there are what are called "matchstick problems" in which math is written in match sticks and you are allowed to move a certain number of them to get a certain property.
In this question we will be considering only integers represented in a 7-segment display format. Here are all 10 digits in that format:
__ __ __ __ __ __ __ __
| | | __| __| |__| |__ |__ | |__| |__|
|__| | |__ __| | __| |__| | |__| __|
Each segment of the display is one "match-stick" which can be moved independently of the rest of the number. Matchsticks are indivisible and indestructible, the cannot be broken or removed by any means.
A common puzzle is to take a number given in base 10 and try to make the largest number possible in a given number of moves. A move is considered to be one movement of a matchstick from any occupied slot to any other unoccupied slot. You are perfectly permitted to make new digits on either side of the number, for example 0 can be made into 77 give 3 moves
__ __ __ __ __ __ __
| | | | | | | | |
|__| , __| , | , | |
However you may not make one slot into 2 or make new slots between existing ones, for example turning a 4 into an 11 in the middle of a number or inserting new digits in between existing ones. Each move need not make a proper number but the final result should be a proper number in the base 10 seven segment display. You need not use every move if you do not wish to. Unlike on puzzling this is a [tag:close ended question] you may not use any operators (multiplication, exponentiation, etc.) or mathematical constants (Pi, Graham's number, etc.) in your answers.
Task
Write a program or function that takes a number and a number of moves as input and returns the largest number that can be made with that many moves on the original number.
This is a code-golf question so answers will be scored in bytes, with less bytes being better.
Test Cases
n, moves -> max
0, 1 -> 9
0, 3 -> 77
0, 4 -> 111
8, 3 -> 74
220, 1 -> 320
220, 2 -> 520
220, 3 -> 7227
220, 4 -> 22111
220, 5 -> 32111
747, 1 -> 747
747, 2 -> 7171
747, 3 -> 7711
919, 2 -> 991
\$\endgroup\$