A company produces two types of gadgets, A and B. The number of gadgets produced is represented by the equation:
$$ x + 2y = 100 $$
where $$ x $$ is the number of type A gadgets and $$ y $$ is the number of type B gadgets. The company also knows that the production of gadget A requires twice the resources compared to gadget B. If the company decides to produce 40 gadgets of type A, how many gadgets of type B can they produce?