The school bought 20 x 10 = <<20*10=200>>200 boxes of pencils.
The pencils cost 200 x $2 = $<<200*2=400>>400.
The school bought 10 x 5 = <<10*5=50>>50 boxes of markers.
The markers cost 50 x $4 = $<<50*4=200>>200.
Thus, the school spent a total of $400 + $200 = $<<400+200=600>>600.
#### 600