Half the volume of a 12 foot high cone-shaped pile is grade A ore while the other half is grade B ore. The pile is worth \$62. One-third of the volume of a similarly shaped 18 foot pile is grade A ore while the other two-thirds is grade B ore. The second pile is worth \$162. Two-thirds of the volume of a similarly shaped 24 foot pile is grade A ore while the other one-third is grade B ore. What is the value in dollars (\$) of the 24 foot pile?

Let's think step by step and output the final answer within \boxed{}.
user