User blog:Nayuta Ito/Thirty-days penalty number

Sorry, this is really tiny.

This is defined for an array of TIME. Each time must be multiple of 5 minutes.

You are at the last non-zero element of the array.

definition
While the array has non-zero element,


 * 1) If you didn't spend time before, spend 5 minutes.
 * 2) If you spent time,
 * 3) If the element left of you is shorter than your element, spend 5 minutes.
 * 4) If you are the leftmost, let the time left of you infinity. In other words, the if cannot be true when you are at the first element.
 * 5) Else, spend 5 minutes and put time ever spent right of you.

example
I am not good at English, so it will be hard to understand. I will show you an example (all the numbers have unit of minutes):

t=0. [20]

t=5. [15] //you did not spend before

t=10. [10,10] // spend 5 minutes [10] and put 10 minutes right [10,10]

t=15. [10,5] // 10 is NOT smaller than 10

t=20. [10,0,20]

t=40. [10] // [10,0,0] is equal to [10]

t=45. [5,45]

t=85. [5,5]

t=90. [5,0,90]

t=180. [5]

t=185. [0,185]

t=370. [0]

So, you spend 6 hours 10 minutes if you start with 20 minutes.

number (actually time)
Thirty-days penalty number (or thirty-days penalty time) is the time you will spend if you starts with [30 days].

This is really small
Please tell me how to make this MUCH LONGER...