That's an yuuuuge amount of natural resources, and I am skeptical of the figure. Regardless, I am not sure I understand your question.
Let me try to answer though. The sanctions are set up to prevent North Korea from selling products, in order to try to force N. Korea to do what the sanctioning body wants them to do.
When the US imposed sanctions on Iraq, the citizens of Iraq suffered economic hardships so severe that an estimated 500,000 children died as a direct result of lack of medicine.
When you look at photographs of N. Korea from space, taken at night, it's territory appears to be a black hole on the surface of the Earth, because N. Korea cannot afford lights. The contrast between North and South Korea is remarkable, as S. Korea is one of the most prosperous countries in the world, per capita.
S. Korea in those photographs is well outlined and lit up by night lights.
Yet N.Korea is testing and building nuclear weapons how do they fund this programs then? thanks for your contribution
Clearly sanctions only restrict specific industries, so N. Korea does also gain funds through international commerce that isn't sanctioned. Also, each nation is capable of having a completely internal economy, and industry that is devoted to purely national progress.
Clearly some combination of these funding sources has been applied to the interest in nuclear weapons.