Optimizing Cloud Resource Usage with Spot Instances: A Cost-Efficient Strategy