Efficiently construct a number using the given operators and base numbers
Efficiently construct a number using the given operations and bases