On a class of rings with inverse weak algorithm