Well I can’t find a common solution for calculating price based on time elapsed and I thought you guys could help me a bit to find an appropriate solution.

So, I need to calculate price like this:
24h - 40€
30h - 50€
36h - 60€
42h - 70€
48h - 80€, so this is it basically for 2 days and the rest should be like this
+8 remaining days the price is 40€ per day plus 2 days elapsed 80€ and for 10 following days price should be 30€ per day, and the rest +20 days and on price should be 20€ per day

Well, for the first day no matter if hours are lower than 24 price would be 40€. After, every 6 hours we charge 10€ which means the total of 40€ and 10€ for 6hours.
So, this is basically for 48h and after that, next 8 days the calculation will be like so:
1day = 40€ plus 80€ for 48hours
8days = 320€ plus 80€ for 48hours

So, if he/she stays more than than 10 days then the price per day should be 30€ plus 400€ for first 10 days.

And if he/she stays more than 20 days and on then the price per day should be 20€ plus 700€ for previous 20 days

Hope, I’m making myself clear and believe me this calculation is giving me a headache