Mathematical Test: If you wanted to test your reasoning skills, then this is the perfect riddle for you. If you…