The Yankees long were the home office for wasting money on the bullpen. They paid set-up man like closers (think Steve Karsay, Kyle Farnsworth and, to some degree, Tom Gordon). They went on a costly post-Mike Stanton lefty hunt (think Felix Heredia, Gabe White, Damaso Marte and Pedro Feliciano).

So when it comes to the Mets’ miscue this year, the Yankees have been there, done that.

Sandy Alderson determined upgrading the relief corps was the most vital short-term requirement. So more than $10 million was invested in 2012 on Ramon Ramirez, Jon Rauch and Frankie Francisco at a time when cutting $50 million in payroll meant there would be pennies for every other shortcoming.

Thus, there is irony that the Mets are surprise contenders in spite of the majors’ worst pen ERA (5.32).

Conversely, the Yankees have one of the majors’ best pens, though they have been without Mariano Rivera, Joba Chamberlain and David Robertson for all or extended portions of this season. Part of that is about, once again, paying a set-up man (Rafael Soriano) like a closer ($37 million for three years).

But for $1.5 million total, the Yanks also had continued to have a deep pen as the C-Worthies — Cory Wade, Cody Eppley and Clay Rapada — had combined for 84 appearances and a 3.00 ERA.

Why have the Yankees gotten better at uncovering buried treasure (think also Boone Logan and Luis Ayala)? They have more clearly defined specific, diversified items they want in a pen, and their scouts have significantly improved at correctly ranking available candidates against what the Yankees have internally. And manager Joe Girardi is a bullpen maestro, excelling at using the whole group to each member’s strengths while not overtaxing anyone.

“I can’t tell you how I appreciate how Joe runs a bullpen,” Yankees assistant GM /personnel head Billy Eppler said. “Joe and [pitching coach] Larry Rothschild are dealt a hand of seven relievers and tend to turn over the right cards. They maximize strengths.”

A strength could get stronger in the coming weeks even in the absence of Rivera. David Aardsma and Chamberlain are inching back toward the majors after surgeries. For now, though, the Yankees will continue having to rely on the C-Men, all of whom initially arrived on minor-league contracts. Here are the stories of their acquisitions:

WADE: While in an airport en route to a wedding in San Diego, Eppler saw on his cell Tampa Bay had released Wade from its minor league system on June 11, 2011. Tim Naehring, the Yankees’ lead NL scout, always liked Wade as a Dodger, and another scout, Josh Paul, recently had filed a positive report. And, by serendipity, Eppler received an email from Mike Fishman, the head of the Yankees’ analytics department, who also saw Wade was available and related that the numbers made Wade an interesting sign.

The Yankees did not have a 40-man roster spot, but Eppler told Wade’s agent, Bobby Barad, they would very soon and, to build trust, offered what amounted to an NBA-style, 10-day contract — if Wade were not on the 40-man by the end of that period, he could leave. Two days later, the righty not only was on the 40, he was on the major league roster. He has never left, using fastball command and a very good change and curve to compile a 2.51 ERA in 69 games as a Yankee.

RAPADA: He was released by the Orioles on Feb. 14 because, manager Buck Showalter told our Ken Davidoff, “We couldn’t afford to take a guy who was a situational [lefty] at that point. We had to have length. We weren’t ready for that piece yet. I knew that somebody would.” That somebody was the Yankees, who could afford a one-batter matchup lefty because they had a lefty, Boone Logan, who could also face righties, plus a trio in David Robertson, Soriano and Rivera that was going to handle the late innings.

Rapada was the classic for this (.562 OPS vs. lefties, .956 vs. righties) and scouts Bill Emslie and Williams told the front office that if Rapada could be limited to lefty-on-lefty, he would be an asset. Even Showalter called it “a great pickup.” Rapada has used his side-winding style to hold lefties to a .448 OPS this year, and actually limited righties to .627 in limited views. In fact, he went into the weekend having retired 20 straight batters (14 of them lefties).

EPPLEY: He is Rapada’s opposite: a righty who has a side-winding motion somewhat similar to Jeff Nelson. Scout Ron Brand championed Eppley because, as Eppler said, “If you are looking to fill a certain niche [righty-on-righty reliever], this guy can fit the profile. He has an above-average major league slider, and his look is different enough that he could be effective. This was a really good job by a scout properly ranking [the candidates] for a role to fit a profile.”