US service-sector activity picked up in May, even as businesses face the fastest growth in input costs in nearly four years.