
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
A certain shopping mall plans to purchase a total of 100 new energy-saving desk lamps of types $A$ and $B$. The cost and selling price per lamp for these two types of desk lamps are as shown in the table below:

| Type | Cost (per lamp in yuan) | Selling Price (per lamp in yuan) |
|------|--------------------------|----------------------------------|
| $A$  | $30$                     | $45$                             |
| $B$  | $50$                     | $70$                             |

Let $x$ be the number of type $A$ desk lamps purchased.

$(1)$ If the shopping mall plans to spend $3500$ yuan on purchasing these lamps, how many type $A$ desk lamps should be purchased?

$(2)$ Let $y$ be the profit obtained by the shopping mall when selling this batch of desk lamps. Write an expression for $y$ in terms of $x$.

$(3)$ If the shopping mall specifies that the quantity of type $B$ desk lamps purchased should not exceed three times the quantity of type $A$ desk lamps, how should the lamps be purchased to maximize the profit when selling this batch of desk lamps? What is the profit in this case?

Present the answer in LaTex format: \boxed{Your answer}
user