Twenty-four years ago, before many of his Maryland men’s basketball players were even born, an energetic recent graduate named Mark Turgeon began coaching the University of Kansas junior varsity team. The Jayhawks were small. So small, in fact, that their power forward stood 6 feet 2. Sometimes he played center.

That was the last time Turgeon ever inserted a five-guard lineup before Thursday night against Denver in the National Invitation Tournament second round.

Backed in to a corner by the Pioneers’ Princeton offense and facing an eight-point deficit midway through the second half, Maryland abandoned its substantial height advantage. Turgeon tossed his motion offense out the Comcast Center windows, calling upon his six guards and swingmen to just play basketball.

They spread four guards along the perimeter, with 6-5 sophomore Dez Wells playing the role of back-down center. Turgeon’s adjustment, initially made in desperation, allowed the Terrapins to squeak out a 62-52 victory over the Pioneers.

Maryland will play the winner of Saturday’s game between Alabama and Stanford on Tuesday in the quarterfinals. Should the top-seeded Crimson Tide win, the No. 2 seed Terps will hit the road. A victory by the fourth-seeded Cardinal would mean one more home game at Comcast Center, where Thursday night’s attendance of 3,982 was the smallest crowd to see a Maryland men’s basketball game in Comcast Center history (breaking a record low set in Tuesday’s win over Niagara).

Six weeks ago, Turgeon said, Maryland (24-12) would have crumbled beneath such unfamiliar circumstances. But these Terps have grown up since mid-February, finding new ways to adapt and win. Facing the end of a six-game, 12-day stretch, one crucial adjustment saved their season.

“We couldn’t guard them,” Turgeon said. “They had complete control of the game. Our post guys couldn’t score against them. So let’s spread them out, try to drive and get to the foul line. There’s no tomorrow. Now there is. There wasn’t. So you went with what your gut told you to do, and we got it done.”

With center Alex Len and his front-court teammates watching from the bench, helpless against Denver’s scrappy game plan, Wells finished with a team-high 19 points, taking advantage of mismatches inside. Seth Allen made the most of his one-on-one matchups, finishing with 13 points. Nick Faust chipped in 12 points, six rebounds, three steals and two assists.

With 8 minutes 53 seconds left, Denver swingman Royce O’Neal snatched a rebound and swung his elbow, clipping Maryland freshman Jake Layman in the face. A whistle blew, signaling a foul on Layman, the freshman’s fourth. Turgeon pleaded for a video review, which ultimately resulted in a flagrant-one foul assessed on O’Neal. O’Neal missed his one-and-one attempt, Faust hit both free throws from the flagrant foul and the Terps began a 10-3 run to regain the lead for good.

“We just followed Coach’s game plan and listened to what he was saying,” point guard Pe’Shon Howard said. “I think that’s the main thing, that we can grow up and execute now. Whereas before, as coach used to say, we couldn’t even run out of bounds plays right after he drew them up.”

Denver (22-10), among the nation’s leaders in two-point field goal percentage thanks to a tedious pace that bleeds clock to find close-range looks, went into halftime with a three-point lead. Before foul trouble, the Terps had no answer for forward Chris Udofia, who consistently broke free for back-door layups. He finished with a game-high 24 points. No other player had more than 10.

Maryland closed the game with points on nine straight possessions, including seven from Wells. Clinging to a 55-52 lead, Turgeon begged his players for a three-pointer, hoping to open up space inside for Wells to work. So Layman stepped into a contested shot on the left wing, pump faked and banked it in.

During his time working under legendary coach Larry Brown at Kansas, Turgeon often heard the same phrase from his mentor: “You just have to figure it out. It doesn’t matter how you do it. Just figure it out.” Turgeon and his legion of guards had done just that.