名落孫山（míng luò sūn shān）
Once in the Song Dynasty there was a man named Sun Shan. One day, he and his friend went to Capital take a test. Afterwards, when the results came up, Sun Shan saw his name in the end of passing list. “I’m on the list! Yes!” But, his friend, was not. Which meant he failed.
Sun Shan went all the way home, where all his friends, family, and neighbors came out to congratulate him. Just then, his friend’s father came up to him , and said, “Congratulations！ So, uh, how did my son do?”
Sun Shan didn’t know how to respond, so he said, “The solutions were Sun Shan’s to make , and Xian Lang was outside Sun Shan.”
What he meant was that Sun Shan was last place on the list, and his friend was after him, which meant that his friend didn’t make it, and failed. And that’s where the idiom [ failing in a test ] came from.
孫山先回到家後，那鄉人便來問他兒子有沒有考取？ 孫山既不好意思直說，又不便隱瞞，於是，就隨口念出兩句不成詩的詩句來：“解名盡處是孫山，賢郎更在孫山外。” 意思是： 字落在榜末孫山的後面，指考試或選拔沒有錄取。