Find the integer points ( x , y ) with Manhattan distance atleast N | C ++ function to find all possible point ; Find all 4 corners of the square whose side length is n ; If n is even then the middle point of the square will be an integer , so we will take that point ; Driver Code ; Printing all possible points
function FindPoints ( n ) { var v = [ ] ; v . push ( [ 0 , 0 ] ) ; v . push ( [ 0 , n ] ) ; v . push ( [ n , 0 ] ) ; v . push ( [ n , n ] ) ; if ( n % 2 == 0 ) v . push ( [ n / 2 , n / 2 ] ) ; return v ; } var N = 8 ; var v = FindPoints ( N ) ; v . forEach ( i => { document . write ( " " + i [ 0 ] + " " + i [ 1 ] + " " ) ; } ) ;