ALi rents a car for d days. He pays m dollars per day for each of first 7 days, and half that rate for each additional day. Find total rent, if d greater than 7?

7m + (m/2)(d-7)

To find the total rent, we need to consider two cases: when the number of days `d` is less than or equal to 7, and when `d` is greater than 7.

Case 1: When d is less than or equal to 7
In this case, Ali has rented the car for 7 days or less. So, the total rent is simply the product of the number of days `d` and the daily rate `m`.

Total Rent = d * m

Case 2: When d is greater than 7
In this case, Ali has rented the car for more than 7 days. So, we need to calculate the rent for the first 7 days and the rent for the additional days separately.

Rent for the first 7 days = 7 * m
Rent for the additional days = (d - 7) * (m / 2)

Total Rent = Rent for the first 7 days + Rent for the additional days
= 7 * m + (d - 7) * (m / 2)

Therefore, the total rent, considering both cases, is given by:

Total Rent = min(d, 7) * m + max(0, d - 7) * (m / 2)

where min(a, b) returns the smaller of a and b, and max(a, b) returns the larger of a and b.

Note: The above approach assumes that the daily rate `m` remains constant throughout the rental period.