Word problem involving linear function