Subnet Mask Optimization

In network 142.100.0.0, we need 3166 subnets and 3 hosts/subnet.

How many subnet bits are needed?

How many host bits are needed?

What possible subnet mask would maximize the number of hosts per subnet?

What possible subnet mask would maximize the number of subnets?