State tax filing

From the info you provided I would multiply the shares by the cost price you have in the second table to get the total $ cost basis; then subtract the $ cost basis for the 51+ shares that did have a cost basis reported, and whatever is left is the cost basis for the 21+ shares.  If you have statements from 2021/2 you can confirm the $ amount from that also.

 

Looks a bit weird reporting tho why your broker would be missing some cost basis for things on the same dates, seems the 21+ shares without basis are the smaller lots with less than 5 shares acquired on same dates as the larger lots.  The share counts tie out exactly but seems the basis on the 51+ comes to $6227 not $7164.  Anyway check the math, but it may not matter since it's all long term gain, as long as your total proceeds and total cost basis is correct.

 

If you are inputting manually be sure to use "one by one" for the non covered so avoid being asked to mail the 1099-B to the IRS.