Let us assume that each soldiers eats one unit of food per day. Thus, total units of food at the beginning will be 1000 x 30 = 30000. After 10 days the 100 soldiers would have eaten 1000 x 10 = 10000 units of food. Thus, food left after 10 days equals 20000 units. Now, there are a total of 2000 soldiers who eat one unit of food everyday.
Now, 30 x 1000 = 1000 x 10 + 2000 x D (here, D is number of days food will last)
⇒ 30000 - 10000 = 2000 x D
∴ D = 20000/2000 = 10 days