Function to check if the number is divisible by 53 or not
bool isDivisible ( string s ) { int flag = 0 ; while ( s . size ( ) > 4 ) { int l = s . size ( ) - 1 ; int x = ( s [ l ] - '0' ) * 37 ; reverse ( s . begin ( ) , s . end ( ) ) ; s . erase ( 0 , 1 ) ; int i = 0 , carry = 0 ; while ( x ) { int d = ( s [ i ] - '0' ) - ( x % 10 ) - carry ; if ( d < 0 ) { d += 10 ; carry = 1 ; } else carry = 0 ; s [ i ] = ( char ) ( d + '0' ) ; x /= 10 ; i ++ ; } while ( carry && i < l ) { int d = ( s [ i ] - '0' ) - carry ; if ( d < 0 ) { d += 10 ; carry = 1 ; } else carry = 0 ; s [ i ] = ( char ) ( d + '0' ) ; i ++ ; } reverse ( s . begin ( ) , s . end ( ) ) ; } int num = 0 ; for ( int i = 0 ; i < s . size ( ) ; i ++ ) { num = num * 10 + ( s [ i ] - '0' ) ; } if ( num % 53 == 0 ) return true ; else return false ; }