Here is an image for the advertising and R&D:

These are no linear relations each.
Continuous Problem:
Assuming we had differentiable functions $a(x)$ and $r(x)$ which take a price $x$ and give the resulting yields. Then the total yield is
$$
y(x_a, x_r) = a(x_a) + r(x_r)
$$
We have the constraints:
$$
x_a \ge 0 \\
x_r \ge 0 \\
x_a + x_r \le 40
$$
As the functions are supposed to be increasing, we think the maximum is on the line
$$
x_a + x_r = 40
$$
and therefore
$$
y(x) = a(x) + r(40-x)
$$
is a function of one variable. Then critical points are at:
$$
0 = y'(x) = a'(x) - r'(x) \iff \\
a'(x) = r'(x)
$$
Discrete Problem:
We can formulate the problem as an integer linear program:
$$
x = (n_1^a, n_2^a, n_3^a, n_4^a, n_5^a, n_1^r, n_2^r, n_3^r, n_4^r, n_5^r)^\top
\in \mathbb{N}_0^{10}
$$
so the variables are the number of times we book advertising or R&D.
The resulting leads go into the cost vector:
$$
c = (500, 900, 1200, 1450, 1600, 1000, 2000, 2500, 2700, 2900)^\top
$$
so the achieved leads are
$$
c^\top x = \sum_{i=1}^{10} c_i x_i
$$
Now the constraints. We have a limited budget:
$$
a^\top x \le 40 \\
a = (10, 20, 30, 40, 50, 10, 20, 30, 40, 50)^\top
$$
and we want non-negative integer solutions:
$$
x \le 0 \\
x \in \mathbb{Z}^{10}
$$
So our ILP is
$$
\max \{ c^\top x \mid a x \le 40, x \ge 0, x \in \mathbb{Z}^{10} \}
$$
Solving this with lpSolve:
We are doing this in R, using the lpsolve solver:
> install.packages("lpSolve")
> install.packages("lpSolveAPI")
> library(lpSolveAPI)
Allocating $10$ variables:
> lprec<-make.lp(0,10)
Setting the objective function:
> set.objfn(lprec, c(500,900,1200,1450,1600,100,2000,2500,2700,2900))
Adding the constraint on budget:
> add.constraint(lprec, c(10,20,30,40,50,10,20,30,40,50),"<=", 40)
Asking lpsolve to maximize:
> lp.control(lprec,sense="maximize")
Solving:
> solve(lprec)
[1] 0
> get.objective(lprec)
[1] 4000
> get.variables(lprec)
[1] 0 0 0 0 0 0 2 0 0 0
Ok. This maximal solution $x = (0,0,0,0,0,0,2,0,0,0)^\top$ means booking two times R&D for 20K each, giving $4000$ leads.
Now we limit the variables to be zero or one:
> set.type(lprec,1,"binary")
> set.type(lprec,2,"binary")
> set.type(lprec,3,"binary")
> set.type(lprec,4,"binary")
> set.type(lprec,5,"binary")
> set.type(lprec,6,"binary")
> set.type(lprec,7,"binary")
> set.type(lprec,8,"binary")
> set.type(lprec,9,"binary")
> set.type(lprec,10,"binary")
and get:
> solve(lprec)
[1] 0
> get.objective(lprec)
[1] 3000
> get.variables(lprec)
[1] 1 0 0 0 0 0 0 1 0 0
which means $10K$ advertising and $30K$ R&D, yielding $3000$ leads.
Which is the OP's obvious answer.