search and divide