Finds sets of gears that fit arbitrary constraints