Versatile optical beam routers based on inversely designed supercell metagratings