Update: So I ran a nearly exhaustive programmatic search. I excluded cases which put Queen or Bishop on the edge of the board, or a Rook on the same rank/file as the Queen or other Rook. Assuming correct code, I could not find any better than cost-33.
I found that @LeonBouquiet's solution is one of 18 distinct cost-33 solutions up to symmetry with a legal position (no pawns on first rank, no bishops on same colour), though they come in nine pairs differing by a single pawn. Including illegal positions, I found 32 cost-33 boards with distinct major piece configurations. This was much more than I had expected, and was then further surprised that given this number there were no cost-32 solutions. First, I'll show the solutions, then talk a bit lot about the algorithm I coded.
Solutions
In case you want still want to give it a go, here's an interesting hint. There are one or more piece placements that are common to all solutions with a legal position. Assuming the Queen to be on the right half:
Ra1, Nd5, c6, and a further two common to all but one of the pawn-pair solutions: c2, c4
And the full solutions (up to symmetry):
Note: black pawns represent alternate pawn placements, and hopefully my brain worked as I had to manually reconstruct pawn placements.
Four solutions using only one rook and seven pawns:
![One rook, seven pawns 1](https://cdn.statically.io/img/i.sstatic.net/INSJD.png)
![One rook, seven pawns 2](https://cdn.statically.io/img/i.sstatic.net/ldw7W.png)
And then twelve very similar solutions using only one bishop, one knight, and all eight pawns:
![One b One n Eight p 1](https://cdn.statically.io/img/i.sstatic.net/DdW3i.png)
![One b One n Eight p 3](https://cdn.statically.io/img/i.sstatic.net/EX4RC.png)
The remaining two solutions which remove a knight and use 5 pawns I'll not repeat - see @LeonBouquiet's solution, noting that the f7 pawn can just as well be on h7.
Among the illegal position solutions, the most interesting one I found was this one, which barely uses the bishops:
Only one is used and it's just covering 3 squares not already covered by other pieces. This leads me to believe that my filter against Bishops and Queens being on the edge of the board could indeed have filtered out valid solutions.
Algorithm
I've uploaded my C# code to GitHub. First I'll note the pawns were a bit of an after-thought. While I did eventually add them to the code, it still outputs just the major pieces so I had to manually fill in the pawns afterwards to get the solutions. I did double-check the solutions though to make sure that I didn't miss any cost-32 solutions, but I'll probably re-verify in the future as I continue to tinker with the code.
I started to code this algorithm when I realized that the number of possible configurations of major pieces might actually be feasibly computable (with all 7 major pieces on the board, there are just under 196 billion possibilities). Then, my plan was to strategically place the pawns 1-by-1 and abort evaluating the board if pawn placement was impossible. Determining impossibility is mainly that the amount of remaining pawns (given the target cost) could not cover the remaining unattacked squares. This strategy ended up working as I only had to fully evaluate roughly 1 board with pawns for every 10 boards without pawns. The core pseudocode:
loop foreach candidate major piece board:
call EvaluateBoard with this board
if success then: celebrate
end loop
function EvaluateBoard:
Determine attacked squares
if all squares are attacked then: exit with success
if pawn placement impossible then: exit with failure
add one pawn such that it attacks a previously unattacked square
call EvaluateBoard with this new board
end function
Old manual cost-34 for posterity
![Chess puzzle 34](https://cdn.statically.io/img/i.sstatic.net/R9nrD.png)