The R5 M330 and the nVidia 820m are pretty much equal to each other. The 840m is more powerful than both those GPUs. The 940m is roughly 10% more powerful than the 840m on average (depends on the specific game).
I would get a laptop with the i5-5500u and the nVidia 940m since that will give you the best gaming performance. The 940m is a relatively weak GPU though compared to higher end nVidia GPUs. It can basically handle games at 1366x768 / 1600x900 resolution and low / medium graphic settings depending on the specific game.