The other two were looking afterwards and kidnapped N as many gems this time. R has the idea.
Credit to everyone.