To just about guarantee qualification, Yuri needed bronze or better (= 24 points), like I wrote here. If he didn't, then if JJ took bronze, he'd have been out. But in a scenario where Yuri came fourth with Yurio also qualifying, then the podium had to be pretty much what we saw: JJ and Yurio with gold and silver (giving them point totals of 30 and 26, or 28 and 28) in either order, and then Michele or Emil with bronze (=22 points). So Sueng Gil (18 points total given his 6th place this time) had to do worse than Yuri (22 points), and either Michele or Emil better.
With 4th, Yuri would have qualified under these circumstances:
JJ, Yurio, Michele/Emil, Yuri
Yurio, JJ, Michele/Emil, Yuri
Because with that silver at the CoC, he's placed higher than Michele/Emil, thus winning the first tiebreaker.
But let's have a look at what else could have happened:
JJ, Michele, Yurio, Yuri => JJ, Otabek, Christophe, Yurio, Phichit, Michele
JJ, Emil, Yurio, Yuri => JJ, Otabek, Christophe, Yurio, Phichit, Emil
JJ, Yurio, Sueng Gil, Yuri => JJ, Otabek, Christophe, Yurio, Phichit, Sueng Gil
JJ, Sueng Gil, Yurio, Yuri => JJ, Otabek, Christophe, Sueng Gil, Phichit, Yurio
Yurio, Sueng Gil, JJ, Yuri => Otabek, Yurio, Christophe, JJ, Phichit, Sueng Gil
Sueng Gil, Yurio, JJ, Yuri => Otabek, Sueng Gil, Christophe, JJ, Phichit, Yurio
And we could also have had this:
JJ, Michele/Emil, Yurio/Sueng Gil, Yuri
in which case the qualifiers would have been
JJ, Otabek, Christophe, Phichit, two of Yurio/Michele/Emil/Sueng Gil based on the second place tiebreaker (total score across both competitions).
I don't even need to go through the scenarios with Michele or Emil winning, right?
This mess of possibilities is why I felt the line of "Yuri has to get 4th or better to go through to the GPF" was odd. There were just waaaaaay too many spoilers. If I'd been a commentator, I'd never have said just "4th or better" -- it'd have been something like "3rd or better for his best chance" or "4th with help."
Yuri basically squeaked through by the skin of his teeth...
p.s. Since three of the silvers were here, with Otabek having already qualified, there would have been no 2nd place tiebreaker scenario for Yuri (i.e. with Yuri and one other on 22 points and a silver as the highest placing, so having to rely on score totals to qualify), so never mind that.
Can you imagine trying to plot this complicated mess out during the planning stages, just to make sure this episode was as tense as possible? I mean, at least in the real GP series, we just have to watch the skaters and hope that they place where they need to place! I'd love to have been in the (writers') room when they went through all the permutations to get this frigging cliffhanger!!