Jacob is putting 18 nonfiction and 30 fiction books on bookshelves. Each shelf will have only fiction or only nonfiction, and every shelf will have the same number of books. What is the greatest number of books for each shelf, and how many shelves will there be for each book?
