question: there are two actions for a user to invest and refund (for example, if An invests 100000 yuan, then he will get a rebate of 10 yuan after maturity). When the user does not make any investment within 6 months, the next investment will be regarded as the first investment (reset in the investment time). Now there is a demand. Given any time, it is necessary to calculate the year of the user"s investment.
I really can"t figure it out.