We can split at i if one of the following two is true . a ) All characters after str [ i ] are 0 b ) String after str [ i ] is divisible by b , i . e . , str [ i + 1. . n - 1 ] is divisible by b .
if ( rl [ i + 1 ] == 0 ) { Console . WriteLine ( " YES " ) ; for ( int k = 0 ; k <= i ; k ++ ) Console . Write ( str [ k ] ) ; Console . Write ( " , ▁ " ) ; for ( int k = i + 1 ; k < len ; k ++ ) Console . Write ( str [ k ] ) ; return ; } } Console . WriteLine ( " NO " ) ; }