In the following question, out of the four alternatives, select the alternative which best expresses the meaning of the idiom/Phrase. At one's wits end
Among three numbers, the first is twice the second and thrice the third. If the average of three numbers is 506, then what is the difference between the first and the third number?