# C (gcc), <s>260</s> <s>187</s> <s>167</s> <s>156</s> <s>152</s> 147 bytes

    i,*m,o;f(e){for(m=L"...",i=0;e>0;o?printf("%.2s%d ","1s2s2p3s3p3d4s4p4d5s5p4f5d6s6p5f6d7s7p"+i++*2,o):0)o=(e-=*m)<0?*m+e:*m++;}

[Try it online!][1] Golfed from the reference implementation.

StackExchange mangles the unprintables, so the value of `m` is replaced with `"..."`.

Here is a reversible hexdump of the program, since it uses unprintables in a string, which replaces the integer array `{2,2,6,2,6,10,2,6,10,2,6,14,10,2,6,14,10,2,6}` with the literal byte values of the integers.

    00000000: 692c 2a6d 2c6f 3b66 2865 297b 666f 7228  i,*m,o;f(e){for(
    00000010: 6d3d 4c22 0202 0602 065c 6e02 065c 6e02  m=L".....\n..\n.
    00000020: 060e 5c6e 0206 0e5c 6e02 0622 2c69 3d30  ..\n...\n..",i=0
    00000030: 3b65 3e30 3b6f 3f70 7269 6e74 6628 2225  ;e>0;o?printf("%
    00000040: 2e32 7325 6420 222c 2231 7332 7332 7033  .2s%d ","1s2s2p3
    00000050: 7333 7033 6434 7334 7034 6435 7335 7034  s3p3d4s4p4d5s5p4
    00000060: 6635 6436 7336 7035 6636 6437 7337 7022  f5d6s6p5f6d7s7p"
    00000070: 2b69 2b2b 2a32 2c6f 293a 3029 6f3d 2865  +i++*2,o):0)o=(e
    00000080: 2d3d 2a6d 293c 303f 2a6d 2b65 3a2a 6d2b  -=*m)<0?*m+e:*m+
    00000090: 2b3b 7d                                  +;}

Alternatively, you could just copy the code from the TIO link.

   [1]: https://tio.run/##RY5NasMwEIXBiyy86BmESohk2cH/KZGdXKBHyMZIdjxgWcJyugm@el01KenAvHnz8RhGRFch1ncYxXCTLarsLEHv@5P/j1Qz946sEAYq1LwjLb13eiKq/sSet/E2l/HZby/BIdQxb08x12czwTh3BG/3qd1KhEOc2NSmJrOZyWRuc5PLwhYm7wpZ2tIUXSkP9mAwA8aCNNT0GFNdkzaqA0Wr@Bwo1h6dML6s7jRSDYzkS4Ok/t1Hrn4h8Id1fyICqEYJR4AqN5MP5xij6Jl9hAhQ/trMbRZ9M5HdZdz94cVf1m/RDc3VrtGgfgA