conditional running total

welcome to shbcf.ru