calculate reverse number to count light cutting plane problem